Jump to content

Alex

Staff Alumni
  • Posts

    2,467
  • Joined

  • Last visited

Everything posted by Alex

  1. You can use file_get_contents() or cURL. Since you're not posting data file_get_contents() will work fine. ex: $var = file_get_contents('http://submissions.ask.com/ping?sitemap=http://www.mysite.com/sitemap_index.xml');
  2. When you're outputting apply nl2br() to it as well.
  3. 'INVALID_HEX_STRING' isn't defined anywhere. You'd have to define it like.. define("INVALID_HEX_STRING", "Invalid hex string... etc..", true);
  4. I prefer working on the back-end. I'm decent with graphics, but I just don't enjoy working with them that much. And I'm terrible with colors and making things it together on the larger scale.
  5. Click the 'top solved' button in the bottom left of the page please.
  6. Well, first off in the form it says 'Submit-pool' and in the code you're using $_POST['submit-pool']. It is case-sensitive.
  7. $ganja=date("D dS M h:i A", time() + (60 * 10));
  8. You'll have to use CRON jobs.
  9. You're looking for mod_rewrite edit: I'm late.
  10. // create an array of permitted MIME types $permitted = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/png','application/msword');
  11. You mean delete everything before or after (like you said) Or delete everything within those 2 variables, like you demonstrated? $string = "12345" $section1 = 12; $section2 = 4; $newstring = str_replace(Array($section1, $section2), NULL, $string); echo $newstring; // 35
  12. Because you want to echo the count, you'd do this: <?php include "db.php"; $sql = mysql_query("SELECT COUNT(id) FROM users"); $row = mysql_fetch_assoc($sql); echo "MythScape has {$row['COUNT(id)']} members!"; ?>
  13. Make the topic as solved. There's a button on the topic page, bottom left.
  14. } else ( echo "I'm sorry, there's a problem with your form. Please try again."; ) should be } else { echo "I'm sorry, there's a problem with your form. Please try again."; } The { and } were ( )
  15. Alex

    Timezone

    Have a drop down menu for them to select their time zone, store it, then use date_default_timezone_set()
  16. Whoops, my fault. I read that wrong.. I'm tired it's after 4am Use Eval() Here's an example: <?php $function = 'foobar'; function foobar() { echo 'foobar'; } eval($function . '();'); ?>
  17. $uploaded_size and $uploaded_type have no value. So of course it won't work. Also, for your $ok, why don't you use a boolean, and just use "true/false"? Would be easier. Additionally, you could just change your structure because the whole $ok, thing isn't even needed. The errors should be enough to notify the uploader that their file wasn't uploaded. You might want to look into filesize() and getimagesize()
  18. You can use a while() loop, a for() loop, or just add an incremented number into your foreach() like.. $i = 0; foreach($r->getItems() as $entry) { if($i >= 5) break; echo '<div class="infoblock">'; echo "<p>"; echo '<a style="font-size: 130%;" href="'; echo $entry['link']; echo '">'; echo $entry['title']; echo "</a></p>"; $line=$entry['content:encoded']; $line=str_replace('/>','>',$line); $line=str_replace('</p>','</p><p> </p>',$line); echo $line; echo "<p style='text-align: center;'><a href='".$entry['comments']."'>Click here for comments or to leave a reply</a></p><p> </p>"; echo "</div>\n"; $i++; }
  19. The literal for single quotes is "read as string". So everything inside of single quotes will read as a string.
  20. Alex

    User levels

    if ($logged['username'] && $logged['level'] == 'mod' || $logged['level'] == 'admin' || $logged['level'] == 'owner')
  21. $this_order = $row[$which]; Anything inside of single quotes will be evaluated as a string. So technically what you had was saying $row['$which'] Actually the string '$which' and not the value of $which.
  22. Why would you use a hidden field? First off that's insecure, those can be edited. All you need to do is use $_SERVER['REMOTE_ADDR'] where ever you're inserting it into the database. Because the file is still being requested by the user it'll still contain their ip.
  23. If it's already in the text file then it sounds like you want to output the exact contents of the file? <?php $textfile = 'datafiles.txt'; $handle = fopen("$textfile", "r"); $contents = fread($handle, filesize($textfile)); fclose($handle); echo nl2br($contents); Or am I wrong?
×
×
  • 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.