i droped it into the root to see if that helped anything.. it didn't. heres the link.
http://unknownerrors.net/searchform.php
i droped it into the root to see if that helped anything.. it didn't. heres the link.
http://unknownerrors.net/searchform.php
very weird, when i make the search page in Dreamweaver, the form action is set to <?php echo $_SERVER['PHP_SELF'];?>
once up loaded to the server, if you view source the action is changed to what ever the file name of the search page is.
Sounds like dreamweaver.
Try doing it in notepad. (you can copy and paste). DW has a knack for parsing scripts during publishing, which is a bad thing.
See what happens if you do it in a plain text editor.
{CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
Follow Me on Twitter: @Negative_Chaos
PHP Code:$result = mysql_query("SELECT finger FROM hand WHERE id=3");
echo $result;
wow, never realized how much crap DW puts in its files.
anywho,
this is what the file i made looks like.
Now, this is what the file looks like on the server.Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php if ($_POST['act'] == "do_search") { //if the action is do_search if ($_POST['q'] == "" || $_POST['se'] == "") { //if query or search engine is blank header('Refresh:3; url='.$_SERVER["PHP_SELF"]); echo 'You must enter a search query and select a search engine to search!'; } else { header('Location: '.$_POST["se"].$_POST["q"]); } } else { //if form not submitted ?> <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST"> <input type="hidden" name="act" value="do_search"> Search: <input type="text" name="q" value=""><BR> <input type="radio" name="se" value=" http://www.google.com/search?hl=en&btnG=Google+Search&q=">G oogle <input type="radio" name="se" value="http://hotbot.com/?loc=searchbox&tab=web&mode=search &currProv=ask&query=">HotBot<BR> <input type="submit" value="Search"> </form> <?php } ?> </body> </html>
theres some code missing.. how is it getting lost from my computer to smartftp though my server to my browser?!Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <form action="/searchform.php" method="POST"> <input type="hidden" name="act" value="do_search"> Search: <input type="text" name="q" value=""><BR> <input type="radio" name="se" value=" http://www.google.com/search?hl=en&btnG=Google+Search&q=">Google <input type="radio" name="se" value="http://hotbot.com/?loc=searchbox&tab=web&mode=search&currProv=ask&query=">HotBot<BR> <input type="submit" value="Search"> </form> </body> </html>
Well, php is a server-side language. Everything in php coding tags is being parsed/read before it get's to the browser.
The browser's source code only displays what you actually physically see on the page (in reference to html vs. php here)
So anything between the <?php and the ?> won't show in the source code. Unless you TELL php to show some things, i.e. the echo ' statement.
{CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
Follow Me on Twitter: @Negative_Chaos
PHP Code:$result = mysql_query("SELECT finger FROM hand WHERE id=3");
echo $result;
Ok, here's a for sure working version. Just edit the parts in red (commented) to suit your needs.
search.php
To see what it does, go to this page (Note, this is my home server. If you can't access it, I may be doing updates or it is turned off.)Code:<?php /* Below is the header section (the part before the search form) of your page. Place it between the HERE tags! */ $head = <<<HERE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> HERE; /* Below is the footer section (the part after the search form) of your page. Place it between the HERE tags! */ $footer = <<<HERE <iframe src="" name="myFrame"></iframe> </body> </html> HERE; if ($_POST['act'] == "do_search") { //if the action is do_search if ($_POST['q'] == "" || $_POST['se'] == "") { //if query or search engine is blank header('Refresh:3; url='.$_SERVER["PHP_SELF"]); echo $head; echo 'You must enter a search query and select a search engine to search!'; echo $footer; } else { header('Location: '.$_POST["se"].$_POST["q"]); } } else { //if form not submitted echo $head; ?> <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST" target="myFrame"> <input type="hidden" name="act" value="do_search"> Search: <input type="text" name="q" value=""><BR> <input type="radio" name="se" value=" http://www.google.com/search?hl=en&btnG=Google+Search&q=">Google <input type="radio" name="se" value="http://hotbot.com/?loc=searchbox&tab=web&mode=search&currProv=ask&query=">HotBot<BR> <input type="submit" value="Search"> </form> <?php echo $footer; } ?>
Hope this helps.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
works like a charm.. thank you very much.
if you want to see what you guys help turned into.
http://alphapirates.com/
far from completed. but working.
Great, at least it's working for you. Let us know if you need any more help.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
Nice. And it works too
Check the spacing in the <title> though![]()
{CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
Follow Me on Twitter: @Negative_Chaos
PHP Code:$result = mysql_query("SELECT finger FROM hand WHERE id=3");
echo $result;
Bookmarks