Saved Bookmarks
| 1. |
Solve : PHP _GET function won't work on "if" statements? |
|
Answer» if ($link = _GET['none']) { alert('None is in your WINDOWS location!') }You're GETTING mixed up with JavaScript and PHP. PHP cannot display alerts, it can only echo the JS code to display it. if ($link = _GET['none']) { alert('None is in your windows location!') } Try: Code: [Select]if ($link = $_GET['none']) { echo "<script type='text/javascript'>alert('None is in your windows location!') </script>"; } Nope. Heres the entire code: function doAction() { var searchFOR = document.getElementById('inta') if (searchFOR.value == 'HerbertsWorld') { window.location = "http://www.herbertsworld.com/members.php?membersID=all&category=rate&input=found&search=" + searchFOR.value document.getElementById('NotFound').style.display = 'none'; } else if (searchFOR.value == 'herbertsworld') { window.location = "http://www.herbertsworld.com/members.php?membersID=all&category=rate&input=found&search=" + searchFOR.value document.getElementById('NotFound').style.display = 'none'; } else { document.getElementById('NotFound').style.display = 'block'; window.location = "http://www.herbertsworld.com/members.php?membersID=all&category=rate&input=none&search=" + searchFOR.value } } function hideResult() { if ($link = $_GET['none']) { document.getElementById('NotFound').style.display = 'block'; } else { document.getElementById('NotFound').style.display = 'none' } } that's the opposite- your trying to put PHP code in a javascript FILE.How would I do it though?Wait its not a js file. Its a .php file.The only php code is the get. yes but I named the file members.php It worked before. Then it broke. Quote from: Bannana97 on April 05, 2009, 12:37:07 PM yes but I named the file members.php That won't do anything. |
|