Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. $allowed_url = array("http://www.google.com/search?hl=en&q=php","http://yahoo.com") Should be $allowed_url = array("http://www.google.com/search?hl=en&q=php","http://yahoo.com"); Missed the semi-colon.
  2. Looks like you need to make sure you have a column called "company" in your database table. If not you need to find out what the name should be.
  3. Bah sorry man. <?php $allowed_url = array("http://www.google.com/search?hl=en&q=php","http://yahoo.com") //get the url from the url - lol $passed_url = $_GET['url']; //this would be http://www.google.com foreach ($allowed_url as $allowed) { if(stristr($allowed, $passed_url) !== false) { header("Location: ".str_replace("url=", "", $_SERVER['QUERY_STRING'])."+help"); exit; } } header("Location: ".str_replace("url=", "", $_SERVER['QUERY_STRING'])."+nohelp"); ?> Removed the dang echo, if anything is outputted to the screen before a header call, then the call does not work.
  4. Here we go loopty loo! <?php $allowed_url = array("http://www.google.com/search?hl=en&q=php","http://yahoo.com") echo $allowed_url[1]; // Actually this would be yahoo, arrays are 0-index based. //get the url from the url - lol $passed_url = $_GET['url']; //this would be http://www.google.com foreach ($allowed_url as $allowed) { if(stristr($allowed, $passed_url) !== false) { header("Location: ".str_replace("url=", "", $_SERVER['QUERY_STRING'])."+help"); exit; } } header("Location: ".str_replace("url=", "", $_SERVER['QUERY_STRING'])."+nohelp"); ?> That should work.
  5. Chances are the new server as register_globals off. You need to code for that as it was a security flaw. Also note that $HTTP_GET_VARS is depreciated. Any instance should be changed to $_GET, same with $HTTP_POST_VARS should be $_POST.
  6. Change this: $result = mysql_query($query); To: $result = mysql_query($query) or die(mysql_error()); And see if it is erroring out. Also see the $_POST issue 3 above this one if you have not already.
  7. Why not just pull it out from the query? $ur=$db->query("SELECT urVOTED FROM user_rating WHERE urVoted like '%_3_%'"); while($vote=$db->fetch_row($ur)) { // should now only contain the votes with _3_ } If you want to do it in a loop for multiple cases, try this. $ur=$db->query("SELECT urVOTED FROM user_rating"); while($vote=$db->fetch_row($ur)) { if (strstr($vote['urVOTED'], '_3_') !== false) { echo '_3_ was found!'; } }
  8. Nail on the head. $_post should be $_POST =) Since PhP Is CasE SenSiTiVe =)
  9. For mysql, don't use the $conn. It is not necessary unless you are using mysqli. But, if you want to know the real error $query = mysql_connect("****************.net", "*********", "**********") or die(mysql_error()); Should be $conn = mysql_connect("****************.net", "*********", "**********") or die(mysql_error()); Then also change this: $conn ="SELECT product_id FROM `customers_products` WHERE company = '".mysql_real_escape_string($_post['company'])."'"; Line 26--> $result = mysql_query($conn,$query); To $query ="SELECT product_id FROM `customers_products` WHERE company = '".mysql_real_escape_string($_POST['company'])."'"; Line 26--> $result = mysql_query($query,$conn); // or remove the ,$conn
  10. The issues it caused could have been easily avoided by using stripslashes then the mysql_real_escape function if magic quotes were on. But yes, it promoted bad coding and alot of people found it hard to understand exactly what was happening. And most people thought, like you, that slashes should be in the database escaping the data, when in actuality they shouldn't. But it is a good to start coding for the future =) If, however, you are making a distribution script. I would make your function like this: <?php function myEscape($string) { return (get_magic_quotes_gpc())?mysql_real_escape_string(stripslashes($string)):mysql_real_escape_string($string); } That way it will not matter if it is on or not on their server, everything gets escaped properly.
  11. mysqli_real_escape_string You need to use the mysqli version not mysql since you are using mysqli...
  12. Yep that should protect you. You are escaping the strings, I see no reason why that would not work. The database removes the slashes because it only "Escapes" them. This is nice cause when you pull the data out of the database to display it, you do not have to stripslahes on that data. It is sort of like when you echo something onto the screen like this: echo "Hello world \"quote\""; That will display Hello World "quote" because the slashes are just escaping the character to prevent an error.
  13. The reason people use BBCode is to store their data in it so it is parseable. This can be parsed by any language as long as you have it setup in a similiar manner. BBCode is universal just each site may have their own variations. Yep, I would go with BBCode.
  14. I am sure it is possible. But probably should go under Third Party Scripts. And for someone just to show you/help you, you should actually try modifying it or post in the freelance section and pay someone to do it.
  15. Did you reboot APACHE since you turned off the quotes. If not restart the apache service, that should work.
  16. substr You would have to do an average of words. Or use split them at the "space" and count them that way.
  17. Sure is. fopen fwrite fclose As simple as that.
  18. HTML is the simple key. As stated, IE8 is beta Chances are not everything is running smooth yet. IMO do not code for IE8 right now, wait until there is an official release that is not buggy. Stop worrying about, it is not a huge issue at all. I am sure if you google IE8 form data process something like that you may find a few bug reports. Stop coding for beta. As long as it works on the current production browsers: IE7, FF3, Opera, Safari, and Chrome you are golden. Chances are it is a BUG in IE8.
  19. You have to link foot_bowls and foot_picks together with a Foreign key. What a foreign key is this: Let's say the picks is the main table and bowls is the subtable. You will need a colum in bowls that is say, pickid which is linked to the pick table on foot_pick.id. This tells the query to pull the results from table bowls and pick where both the pickids are the same. What you probably have is bowls has its own unique generated id and picks has it's own unique generated id. Both need this, but the bowls table also needs an extra column to hold the related picks id. This is how relational databases work. They have to know how to link 2 tables together and usually this is done by a common id, or foreign key. Hope that helps ya. I would read up on Relational databases and foreign keys.
  20. function get_rank($sExp, $eExp) Like that, pass in the start and the end.
  21. IE8 is beta, whocares if it works on it lol. Chances are, and this is a pure guess is that IE8 is being picky about the html and it probably needs to be setup a certain way. I would do a print_r($_POST); in your script and see what prints in IE8 vs FF. See if they are forumalted differently or what. It could just be that IE forms submitting is flawed and that is why your database does not update. I have yet to use IE8, so yea this is purely ways to debug this situation. My bet, is IE8 has a bug on the form submital process since it is BETA.
  22. Try running that query in PHPMyAdmin and see what happens. Also try running SELECT * FROM rank where start >= 0 And see what is returned and do the same with just end. Also try removing the single quotes (') and see if that helps at all.
  23. array array_unshift — Prepend one or more elements to the beginning of an array array_push — Push one or more elements onto the end of array
  24. Are you sure you have data? Are you also sure you have data for that user? Are you also sure that there is data in picks and bowls that are linked together?
  25. Not done in PHP http://www.codeproject.com/KB/scripting/JavascriptInfoBar.aspx For the infobar. http://detect-ad-blocking-software.webconrad.com/ For the ad blocking.
×
×
  • 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.