-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
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!
-
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!
-
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
-
i haven't tested this but it looks cool phpuserbase EDIT: ooops i think killed there demo!!! can you login ?
-
$_SERVER['HTTP_REFERER'] returns blank with some ISP's so i choose not to use it.
-
search forum for "pagination"
-
Printing the contents of my website using PHP
MadTechie replied to fekaduw's topic in PHP Coding Help
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.. -
SMTP etc setup correctly in the php.ini
-
[SOLVED] Checking if an image exists using fsock?
MadTechie replied to RickyF's topic in PHP Coding Help
can you post your code.. please EDIT: remove the closed the class with the last } see revised code (posted via PM) -
[SOLVED] Checking if an image exists using fsock?
MadTechie replied to RickyF's topic in PHP Coding Help
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 -
[SOLVED] Checking if an image exists using fsock?
MadTechie replied to RickyF's topic in PHP Coding Help
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 -
my login doesn't write to banip.txt or to my hacklog
MadTechie replied to CBaZ's topic in PHP Coding Help
Read keeB Comments.. they make sense! revise your code to suite.. nice job keeB -
looks like the tmp file isn't being created! access right ?
-
<?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
-
[SOLVED] Checking if an image exists using fsock?
MadTechie replied to RickyF's topic in PHP Coding Help
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); } } ?> -
my login doesn't write to banip.txt or to my hacklog
MadTechie replied to CBaZ's topic in PHP Coding Help
your not writing to the file! whats the QUERY FAILED error ? @GingerRobot thats only a display issule (he used quote not code) -
This should be fine.. define "jumbled up".. maybe a more complete code!? ie the full table setup (HTML table)
-
[SOLVED] PHP Flood Protection scripts that uses flat file databases?
MadTechie replied to RickyF's topic in PHP Coding Help
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 :-\ -
both about the same but i would probably choose $points = $the[1] + $rand; mysql_query("UPDATE `theIDs` SET `points` = '$points' WHERE `id` = '$getID'");
-
[SOLVED] PHP Flood Protection scripts that uses flat file databases?
MadTechie replied to RickyF's topic in PHP Coding Help
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! -
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
-
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>
-
Can u please explain the php mail script below ?
MadTechie replied to jd2007's topic in PHP Coding Help
you don't need buffering for emailing (except in that code!!!) dump it.. use PHPMailer thats my advice! -
really depends on the database setup.. do you have a DB schema?
-
[SOLVED] PHP Flood Protection scripts that uses flat file databases?
MadTechie replied to RickyF's topic in PHP Coding Help
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