Jump to content

mikesta707

Staff Alumni
  • Posts

    2,965
  • Joined

  • Last visited

Everything posted by mikesta707

  1. your codes a mess, and very hard to read (but that may be due to the forums) but from what I can see, you never pass the name of the state to the next page. <input type="hidden" value="<? echo $state_name; ?>" /> where $state_name is the name of the state you pulled from the data based. that will create a hidden field to send the state name to the next page, but I really can't read your code to well, so I can't tell if this will apply hope that helps
  2. ok just wasn't sure, been doing java lately,
  3. well first off the following line stripos(basename($file), $query[0]) !== false only checks if the first word of the query is in the file name something like foreach ($query as $q){ if (stripos(basename($file), $q]) !== false){ $results[] = $file; break; } } instead of that if statement will check every word of the query also I think you may want to use the array_push function instead of the line $results[] = $file; It's been a bit of time since I've tangoed with PhP heavily, but I am not sure if you can add entries into an array that way hope that helps
  4. thats because you are echoing an array. you have to use foreach or something to echo every element of the array foreach ($echo as $key => $value) { echo "Key: ".$key." Value: ".$value."<br />"; } that would show each entry in the array, plus its corresponding key
  5. if (strpos($searchDesc, "stuff") !== false){ echo "Succes"; } else { echo "Fail"; } I don't know what to tell you, im running out of ideas
  6. html entities will make sure that any html code that anyone puts there won't get executed, so you should be ok. I don't see how slashes would be bad if nothing is being executed so maybe put an example of what "bad" is being shown on the page
  7. try using the single quote escape characters (\') around users (your table name)
  8. well firstly, strpos doesn't return a boolean value unless its false, it returns an integer value, so that might be what is causing problems. try something like if (strpos($searchDesc, "stuff") === false){ echo "Fail"; } else { echo "Success!"; }
  9. post the code you are using to search for it. If its there like you say its there, a simple search function should fine it.
  10. try searching for the newline character \n or the carriage return character \r
  11. Do you only want to show the results directly after someone has voted, and any other time they access index.php they can vote again? Well if so, there are multiple ways you can do that. Off the top of my head, an easy way would be to have your voted page pass a get variable to the index page (IE instead of going to index.php go to index.php?voted=yes or something) and on the index page check if the get variable has the correct value and then show the results. if not show the form
  12. I don't think you will be able to reset the session variable, without refreshing the page since PHP is parsed server side. All the reset button does is clear the value of the HTML form I'm not really sure how to accomplish what you want to accomplish. Sorry, hope this helps
  13. well in this code, everytime you run the while loop, the xml page deletes the sitemap.xml page and reopens a new one. you might want to do that before your while loop. as for making it make every page have only 49,999 links do something like $runs = 1;//which page we are one while ($row_sitemap = mysql_fetch_assoc($sitemap)){ //yourstuff $i = 0;//counter $limit = 49999; $filename = "sitemap".$runs;//open this file while ($i < 49999){ //write to the file //remember to increment the $i value } $runs++; } Hope that helps!
  14. help? yes. write it for you? no. you can post in the freelance forum is you want to pay someone to do it for you
  15. the easiest thing to do would be to make a function that uploads something, and just call that function mulitple times. Honestly, your script is perfectly fine, just put it a function, and you will be good to go
  16. well.. what you have their is technically right. show us your actual code, it looks like a simple syntax error based on the message you got. probably an extra quote or something
  17. the mysql command "like" is probably around what you looking for http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html there is also a "not like" command that is on that same page you will probably want to check out as well
  18. just number_format($number); should print it without decimals
  19. ... whatever you are including on line 88 isn't where you think it should be. check your file paths
  20. well you could just write a script that uploads the text to a database, and then on the front page just show the latest article. Its pretty much basic SQL queries so it shouldn't be that hard to figure out.
  21. so you want to simply include a page in that coupons page based on which link they pressed. Thats just a simple include. set your links up like <a href="coupons.php?page=Acme" >acme coupons</a> and then on coupons.php have some code that is like if (isset($_GET['page'])){ include($_GET['page'].".html"); } else { //show content on coupons.php } of course you are going to want to validate that the get variable is actually a page that you have on the server
  22. Yeah i realized what I was doing was pretty stupid haha. Instead I just had my object return the mysql resource instead of what I had before, kinda like what neil.johnson wrote. thanks alot of your input!
  23. You can use the Distinct command in MYSQL something like $query = "SELECT DISTINCTcolumn_name FROM tablename";
×
×
  • 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.