Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. those three lines can be merged together into if (!preg_match("/^.*\.(gif|jpg|png)/i",$file)) { That will match files ending in .gif .jpg or .png. It will also be case-insensitve
  2. That error is saying PHP is unable to find the file global.php in /home1/reviewer/public_html/divinehealthwellness/includes/. Have you made sure the include folder exists and that global.php is placed within it?
  3. You left off the semi-colon at the end of this line $email = $_POST['email']
  4. Use $_GET['email'] not $email to retrieve the email from the url.
  5. How are you checking it in the database? Post the schema for your node table, maybe you have setup your color field incorrectly.
  6. Where? In the databases or some other place. You need to be more specific.
  7. On method is to add an iframe. Then in your links instead of using _blank as the target you'll provide the name of your iframe. Or the more modern method is to use Ajax
  8. In that case the example code you posted should work fine. Just make sure you escape all your variables (as I demonstrated above) within the code you're search/replacing. As I said before PHP wont execute code defined within strings. Only variables.
  9. You should pass $data[$j][2] to your function when you call it. function yburg($num) { if (intval($num) == 5) echo "The PLU number 5 is a Cheesburger"; } for ($j = 0; $j < $count2; $j++) { yburg($data[$j][2]); echo $data[$j][2], $data[$j][3], '<br />'; }
  10. Placing PHP code within strings wont get executed. However you'll need to escape variables though. Example code $source = <<<CODE <?php \$var = 'some value'; echo strtoupper(\$var); ?> CODE; // do something with $source echo $source; // outputs the code typed above To execute code within a string you'll need to use eval
  11. When you go to report.php what do you see when you right click and select view source? If the source code is blank then it means there is an error in your code preventing the script from running. In this case I would recommend you to turn display_errors to On and setting error_reporting to E_ALL. Save the php.ini and restart Apache for changes to take effect. Errors should now be displayed during run time. However if you see your PHP source code (which you shouldn't be able to do) it means Apaches isn't configured correctly.
  12. In PHP you can do $time = strtotime('+12 Days 5 Hours 10 Minutes'); $sql = "INSERT INTO `restrictions` (`userid`,`enforcer`,`topics`, `posts`, `timeout`) VALUES ('1','1','1', '1', $time)"; mysql_query($sql); That will insert the timestamp for 12 Days, 5 Hours and 10 Minutes from now.
  13. short_open_tag is a PHP setting found within the main configuration file (php.ini). If you're on shared hosting it is more than likely you wont have access to this file.
  14. You cant call functions on field names for an insert statement (only for select). You can call MySQL functions for field values though. INSERT INTO `restrictions` (`userid`,`enforcer`,`topics`, `posts`, `timeout`) VALUES ('1','1','1', '1', UNIX_TIMESTAMP())
  15. Need the HTML as well to make sense of your CSS. You may be better of posting a link to a live page which shows the problem you're having.
  16. When the setting short_open_tag is enabled it allows you to use short hand syntax such as <? ?> instead of <?php ?> or <?='hello'?> instead of <?php echo 'hello'; ?> However this setting is now depreciated and is disabled by default. It is always best to use the full PHP syntax as this will allow your code to be more portable.
  17. Look into the pathinfo function.
  18. Your calling the MySQL function UNIX_TIMESTAMP within your field list clause. This is not possible. What are you trying to do?
  19. Just posting the code for the comment wont help . We'll need to see your HTML/CSS has and if possible a live demonstration of your issue. Moving to HTML Help
  20. You most probably have short_open_tag enabled and PHP is trying to parse this as PHP code: <?xml version="1.0" encoding="UTF-8"?> In which case you should echo that line to prevent this from happening <?php echo "<?xml version=\"1.0\" encoding=\"UTF-8\"; ?>\n"; ?>
  21. What issues are your facing when adding those lines to your script? Also in order for browsers to apply your CSS properly you need to provide a doctype. Otherwise you will experience unexpected behaviour.
  22. Where are you saving your html/php files to? By default you must save them in Apaches htdocs folder (eg C:/path/to/Apache/htdocs) How are you running your .html/.php files? If you have Apache installed and configured correctly with PHP make sure you're going to http://localhost/ PHP is a server side language. Web browsers do not understand PHP, only HTML/CSS/JS etc.
  23. You only need to change the code in the function, which is what I highlighted in my post above However when calling the function you'd do something like this // call the function // as the function now returns something we need to catch it $info = test("adam1984", "[email protected]"); // check that the function returned an array if(is_array($info)) { echo 'Username is: '. $info[0]. '<br />'; echo 'Email is: '. $info[1]. '<br />'; } else { echo 'FAILED'; }
  24. Rather then print the username/email when you have converted them assign the to a variable, eg $username, $email then use the following to return an array return array($username, $email) Change print ucwords($username); print "<br />"; print strtolower($email); } else { print "No dice, FALSE"; to $username = ucwords($username); $email = strtolower($email); return array($username, $password); } else { return;
  25. Correct syntax: $sitemap = ''; foreach( $finalurl as $key => $value){ $sitemap .= '<url><loc>http://www.$mainsiteurl.com/'.$value.'</loc><changefreq>daily</changefreq><priority>0.9</priority></url>'; } echo $sitemap;
×
×
  • 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.