Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. Use LIKE $query_Search = "SELECT * FROM search WHERE theField LIKE '%{$_GET['searchfield']}%'"; this will find a wider range.. note % = wildcards so %tech% will find madtechie and so will %techie and mad% you get the idea!
  2. Personally i use $_SESSION as its is preferred, as of PHP 4.1.0 start_session(); $_SESSION['username'] = "MadTechie"; $_SESSION['password'] = "notsaying"; echo "Hello ".$_SESSION['username']; instead of storing the username store the UserID, and a hashkey instead of password.. link the hashkey to another table that is created on login, this is a long topic!
  3. to get the preg_match_all working use preg_match_all("/{$_GET['searchfield']}/", $row_Search['bandname'], $match); but thats not the problem.. i think you want something like.. $query_Search = "SELECT * FROM search WHERE theField='{$_GET['searchfield']}'"; $Search = mysql_query($query_Search, $search) or die(mysql_error()); of course change theField to the field your searching also $search and $Search are NOT the same and $search should be the connection string
  4. i haven't tested this but it looks cool phpuserbase EDIT: ooops i think killed there demo!!! can you login ?
  5. $_SERVER['HTTP_REFERER'] returns blank with some ISP's so i choose not to use it.
  6. search forum for "pagination"
  7. PHP is a SERVER side script.. Javascript is a CLIENT side script... The printer is on the CLIENT side thus PHP can't do this.. infact javascript could probably only display the print dialog..
  8. SMTP etc setup correctly in the php.ini
  9. can you post your code.. please EDIT: remove the closed the class with the last } see revised code (posted via PM)
  10. add the rest of the code below the //Add to the very end of your file. and add it at the end of the file
  11. To add your code <?php //add to code $url = "http://us2.php.net/images/php.gif"; $found = rfile_exists($url); //example if($found) { echo "found"; }else{ echo "not found"; } //Add to the very end of your file. <?php function rfile_exists($url) { if( !is_numeric(xfile_404($url)) ) { return true; }else{ return false; } } function xfile_404($file){ $file = ereg_replace(' +', '%20', trim($file)); if(substr($file, 0, 7) !== "http://") { $file = "http://" . $file; } $domain = substr($file, 7); $file_headers = @get_headers($file); if(!$file_headers){ return 3; break; } if($file_headers[0] == 'HTTP/1.1 404 Not Found') { return 404; }else{ return ereg_replace('%20', ' ', $file); } } ?> Posting your code may help us
  12. Read keeB Comments.. they make sense! revise your code to suite.. nice job keeB
  13. looks like the tmp file isn't being created! access right ?
  14. <?php header("Content-type: image/png"); $im = @imagecreate(110, 20) or die("Cannot Initialize new GD image stream"); $background_color = imagecolorallocate($im, 0, 0, 0); $text_color = imagecolorallocate($im, 233, 14, 91); imagestring($im, 1, 5, 5, "A Simple Text String", $text_color); imagepng($im); imagedestroy($im); ?> imagecreate
  15. Why not this <?php $url = "http://us2.php.net/images/php.gif"; if( !is_numeric(xfile_404($url)) ) { echo "Found<br>"; echo "<img src='$url'>"; } function xfile_404($file){ $file = ereg_replace(' +', '%20', trim($file)); if(substr($file, 0, 7) !== "http://") { $file = "http://" . $file; } $domain = substr($file, 7); $domain_ext = strtoupper(array_pop(explode('.', substr($domain, 0, strpos($domain, '/'))))); $file_headers = @get_headers($file); if(!$file_headers){ return 3; break; } if($file_headers[0] == 'HTTP/1.1 404 Not Found') { return 404; }else{ return ereg_replace('%20', ' ', $file); } } ?>
  16. your not writing to the file! whats the QUERY FAILED error ? @GingerRobot thats only a display issule (he used quote not code)
  17. This should be fine.. define "jumbled up".. maybe a more complete code!? ie the full table setup (HTML table)
  18. totally agree with you ToonMariner.. but if its a simple comment box at the bottom of a artical then a captcha would work.... maybe add a timestamp to stop repeats but more people just click the submit button 200times.. thus i put the sesssion code :-\
  19. both about the same but i would probably choose $points = $the[1] + $rand; mysql_query("UPDATE `theIDs` SET `points` = '$points' WHERE `id` = '$getID'");
  20. i think we need to know more about the system as.. we can all add ideas until the cows come home.. but it depends on the needs!
  21. 1. check the Smarty.class.php is uploaded to the site 2. check the name is Smarty.class.php not smarty.class.php 3. check their in the location
  22. try <?php $depts = $db->Execute("SELECT * FROM test_find WHERE job_id='$batch_nr'"); while($row= $depts->FetchRow()){ $notes = $row['notes']."<br>"; } ?> <td><?php echo $notes; ?></td>
  23. you don't need buffering for emailing (except in that code!!!) dump it.. use PHPMailer thats my advice!
  24. really depends on the database setup.. do you have a DB schema?
  25. in which case $delay = 60*60*24; //seconds = 1 day BUT your session will probably only last 15 minutes.. you could store the ip in another file with a time stamp
×
×
  • 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.