Jump to content

fook3d

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

fook3d's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. date() will give you more information about date(). date('l', $timestamp); will return Sunday if the date you are viewing it is a sunday. So surely a simple if statement will make it bold? <?php $day = date('l', $timestamp); if($day == 'Sunday') echo '<b>' . $day . '</b>'; else echo $day; ?> Or am I missing something?
  2. Correct me if I am wrong, but is a "call back" not something like what paypal uses to post data back to another server and set a payment as made? I have heard people call that process both "call back" and "post back" Is this not what you are referring to?
  3. Use a login_name and user_name field. login_name stays the same forever, while any update in the site shows as user_name, which means all places where a user name is used in the site, would run from the user_name row
  4. Hey guys and girls, as always, regex has me pulling out my hair. Basically, its for a BB parsing engine to only allow URL's ending in image formats I choose, here are the details. From BB to HTML $text = preg_replace("\[img\](.+?)\.(png|gif|jpg)\[\/img\]", "<img src='$1.\\2' />", $text); From HTML to BB $text = preg_replace("\<img src\='(.+)\.(png|gif|jpg)\' \/\>", "[img=\\1.\\2]", $text); Error: Warning: preg_replace() [function.preg-replace]: Delimiter must not be alphanumeric or backslash in /path/and/filename.php on line xxx (Numbers are those lines above) Any help on this will be greatly appreciated.
  5. I see, guess that is a personal preference thing, for me, i find codes easier to read where every "if" statement is seperate, others prefer to use "else if" too, whereas i don't like using them. Doubt it makes much difference which way you use it to be honest. Maybe you could tell me if there is a reason to use "else if" over "if's and exits" ? <?php // If it doesn't exist, the page exit()'s $this_q = sprintf ( // The main query "SELECT * FROM `table_name` WHERE `row_name` = ('%u')", // The argument $_GET['id'] ); $DoesExist = mysql_query($this_q) or die (mysql_error()); if(!mysql_num_rows($DoesExist)) { echo 'This feature does not exist.'; // Change to your footer file/function include "footer.html"; exit(); } ?> Sure does block the insert query in the page if that is above it, all data is checked before this also, so should be pretty secure
  6. I assume you refer to // Change to your footer file/function include "footer.html"; Which can be either a file (Eg. footer.html) or a function (Eg. PageFooter()) along with other things, like class values ($variable->footer) etc.
  7. Firstly, check a value isset(), then check the id value is numeric, then search the database for a valid result <?php // If no id, tell them to select one if(!isset($_GET['id'])) { echo 'You did not select a feature to view.'; // Change to your footer file/function include "footer.html"; exit(); } // Check the value is numeric.. if(isset($_GET['id']) and !eregi("[^0-9]", $_GET['id'])) { echo 'The feature ID must be numeric.'; // Change to your footer file/function include "footer.html"; exit(); } // Now check the database for the value of the post // If it doesn't exist, the page exit()'s $this_q = sprintf ( // The main query "SELECT * FROM `table_name` WHERE `row_name` = ('%u')", // The argument $_GET['id'] ); $DoesExist = mysql_query($this_q) or die (mysql_error()); if(!mysql_num_rows($DoesExist)) { echo 'This feature does not exist.'; // Change to your footer file/function include "footer.html"; exit(); } // Script continues here if no errors in the $_GET['id'] ?> A rough way i would do it.
  8. You are resetting the $headers value before you are not using the .= operator. Using the code below will show all the $header lines. <?php $to = $Admin_Email; $headers = "From: $Admin_Email \r\n"; $headers .= "Reply-To: $Admin_Email \r\n"; // To send HTML mail, the Content-type header must be set $headers .= "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n"; ?> To see what value it is returning, use echo $headers; below all the $headers variables. If this isn't what your asking, look past it, I'm a dumbass at times and don't fully understand your issue
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.