Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Cobb

Members
  • Joined

  • Last visited

  1. I hadn't closed my for each loop, i think that was all it was! Whoops. Thank you.
  2. What does, the class?
  3. Still the same problem. Here's the code for the class. <?php class EmailDetails { public $id; public $name; public $subject; public $body; public $email; function __construct($inId=null, $inName=null, $inSubject=null, $inBody=null, $inEmail=null) { if (!empty($inId)) { $this->id = $inId; } if (!empty($inName)) { $this->name = $inName; } if (!empty($inSubject)) { $this->subject = $inSubject; } if (!empty($inBody)) { $this->body = $inBody; } if (!empty($inEmail)) { $this->email = $inEmail; } } } ?> If it's a problem with this class though I don't understand why when i made GetEmailContent do nothing else, but echo a string, it wouldn't even do that.
  4. Still doing the same thing. I'm editing the file directly on the server.
  5. Although that was very stupid of me, unfortunately that's not all it is. I only added that line so i'd have some indication on screen of how far the code was getting because of these problems. I've terminated it now and i still have the same problem.
  6. Seem to be having a bit of a problem calling a function from another php file. Here's my code: <?php include ("includes/includes.php"); $name = $_GET['name']; echo $name $emailDetails = GetEmailContent($inName = $name); foreach ($emailDetails as $post) { $subject = $post->subject; $body = $post->body; $email = $post->email; echo $name; echo $subject; echo $body; echo $email; ?> This also html in this file, but all that is working fine. includes.php: <?php include 'blogpost.php'; include 'emailDetails.php'; // Connects to DB successfully function GetBlogPosts($inUrl=null, $inTagId =null) { //This function works } function GetEmailContent($inName=null) { echo "in function"; if (!empty($inName)) { $query = mysql_query("SELECT * FROM shop_email WHERE name = '$inName' ORDER BY id DESC"); } else { echo "inName empty"; } $emailArray = array(); while ($row = mysql_fetch_assoc($query)) { $emailContent = new EmailDetails($row["id"], $row['name'], $row['subject'], $row['body']); array_push($emailArray, $emailContent); } return $emailArray; } ?> When trying to run the first bit of code, all i get returned is a blank white page in firefox, and 'HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.' in chrome. By commenting things out i've worked out that everything works until the '$emailDetails = GetEmailContent($inName = $name);' line, that's when the page starts loading as blank. I've also tried commenting out the entire GetEmailContent function, apart from 'echo "in function"', and i still get the same problem. It seems to me like there's some problem actually calling the function. Any help would be massively appreciated, thank you.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.