Jump to content

rhock_95

Members
  • Posts

    120
  • Joined

  • Last visited

    Never

Everything posted by rhock_95

  1. another way to ban an IP...FWIW <?php $deny = array("111.111.111", "222.222.222", "333.333.333"); if (in_array ($_SERVER['REMOTE_ADDR'], $deny)) { header("location: http://www.google.com/"); exit(); } ?>
  2. how does "file.php" know what the original variable was ($query=product vendor) if it not passed in the URL?
  3. Thanks for the reply and the effort...I see how this could be used but I don't see how it can help use in my existing script... in a nutshell...all I want to do is hyperlink the city names in the displayed results (the product has already been selected...by clicking the city name it refines the query to just those vendors in the "clicked" city... Thanks again...
  4. I'm still looking for suggestions on a way this can be done TIA
  5. Thanks for the reply... as it stands now...the user has already selected a product category ($query) from a drop down menu...and the results are displayed...I then offer a second drop down menu ($city) where the user can refine the search to only show contacts located in the selected city... I could make it easier (no drop down) for the user if the city names were hyperlinked that when clicked would display the "refined" results with the second variable ($city)...but I wanted the original script to do this not with the way the "city" name is entered into the db...I can do that but the the script that the "hyperlink" calls does not know what the original "$query" was... $results = mysql_query("SELECT `name` , `address` , `city` , `phone` , `www` ,`id` FROM `category_list` WHERE 1 AND `category` LIKE '%$query%' ORDER BY name ASC LIMIT $page, $limit"); while ($data = mysql_fetch_array($results)) can you show me how to add the second variable ($city) to this query? Thanks again...
  6. hi, I have a script that displayes search results as a list of vendors for particular products the results include NAME;ADDRESS,CITY;TELEPHONE etc... What I would like to do is "hyperlink" the "CITY" dispayed so when clicked it refines the results to disply only those vendors located in said CITY... can I do this wihtin the script or does it have to be done in the stored (CITY) data in the database? in the current script that searches for the products "$query" can I add a second variable $city and use a secondary GET script that will do what I want? I am not a coder but I can hack scripts fairly well...if anyone has any code that does anything similar to this I would love to see it...TIA
  7. thanks for the follow up replies It looks like an included (page) header was causing the error (I've had "('error_reporting',E_ALL); " running from the onset) regardless... it still does not redirect the page... have disturbed some other code and will try the latest suggestion as soon as I get it back together... thanks again...
  8. there is no error unless I try redirect a user that submits an empty query request none of the common (see the sticky) solutions apply...
  9. my question was ..."is there another way to redirect a user using an if statement"
  10. I am trying to use the following "if" statement but I get the "cannot modify header information - headers already sent........ if ($query == ""){ //echo("No results found matching your query - $query"); header('location: http://sitename.com/search.php/'); exit();} is there another way to redirect the user if the query is empty?
  11. OK thanks...but I am going to need more information on how to use this... my current "While" statement looks like: while ($row=mysql_fetch_array($result)) how is this effected? also... where in the if statement where/how would I echo the Adsense text string? thanks again...
  12. anyone have a snippet that will display a (default text ad) string the same as a $row result in a while loop ? I would like to display a Google Adsense Ad about every 10 row or so... TIA
  13. I solved this problem with the following code: $deny = array("111.111.111", "222.222.222", "333.333.333"); if (in_array ($_SERVER['REMOTE_ADDR'], $deny)) { header("location: http://www.google.com/"); exit(); } if the IP=true the browser is redirected to Google.com [could not find the "solved" link...]
  14. to clarify... I want the search engines crawling the page...I just don't want them executing the log file script... I want to see what my users are searching for but the crawlers are constantly loading the log file so it is difficult to see whatr actual users are looking for... My intention is to simply stop certain IP addresses from executing my logging script.. I thought I could do this with an "IF" statement but so far no joy...
  15. Geeze...! this is nothing but a flat file log script I have running on my own search form that searches my own database...but because I have Google Adsense ads running in the results pages... the spiders are constantly crawling the form and executing the log script... all I am trying to do is stop the script from logging the data if an IP address matches the searchbot IP addresses...
  16. I can't get your original snippet to work if($ip == whatever you want){ carry out this action } if I use my own IP and tel it to close the file...it still logs the data... i.e., the "if" statement does nothing..
  17. Thanks for the reply... can you elaborate a bit? "whatever you want" can this be "$array"? and $array=xxx.xxx.xxx.xx0 $array=xxx.xxx.xxx.xx1 $array=xxx.xxx.xxx.xx2 $array=xxx.xxx.xxx.xx3 ?
  18. Not being a coder (just a hack)...I think I need an if statement...? I have a logging script that runs on a search form...the problem is Google and other searchbots load up the log file... Can I use an if statement to match IP addresses against an array of IPs ? and "if" the IP matches one in the array close the file? (write nothing) "else" it writes the data...? here is the logging script: <?php $hFile = fopen( "./logs/log.txt", "a+" ); fwrite( $hFile, "\n$city;$query;$category-"); fwrite($hFile,date("l, F jS Y - H:i:s-").($ip = $_SERVER['REMOTE_ADDR'])); fclose( $hFile ); ?> TIA
  19. can I use PHP or possibly the curl _mod to POST id and passwd data stored in a .htpasswd file to access a page inside protected directory?
  20. I got it... LIKE '%title%' works like a charm... Thanks for the help...
  21. you lost me now...can you show me an example of using LIKE with the query posted?
  22. Not sure that would work because the & is actually in the title (data) as part of the record. This particular script runs inside the results of a parent script... it allows the user to display all the names with the same "title"... ...the parent script originally returns all the names and titles
  23. $sql="select * from table where name='$name' and title='$query' ORDER BY name"; My problem is the above query works fine unless the data in the "title" column has an "&" in the text...then the script does not display any results...is there a way to correct this with the query or do I have to change the records? TIA
  24. I am testing on two different smartphone emulators, a small screen cell phone and a PDA and so far I have not had any problem with the displays...php works very will with wireless protocol and like a charm on the newer phones... ...all the pages are stripped down to just content to keep the bandwidth to a minimum...most services charge per / KB rather than by the minute... Thanks again...
×
×
  • 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.