Hello, I need some help with a my new site all i need is a simple code that is basically is a form that looks like this the form sends the visitor to /allowed.html or www.mysite.com/allowed.html if they write the right code "123456" for example and if they write anything else they get error and they get to enter it again can anyone do this for me please....!
Have one file.... example index.html or index.php <form action="submit.php" method="post"> Code: <input type="text" name="key" /> <input type="submit" /> </form> HTML: Another file, submit.php <?php $d=date("D"); if ($_POST["name"]=="123456") header("Location: www.mysite.com/allowed.html"); else header("Location: www.mysite.com/denied.html"); ?> PHP: That should do it
Hello buddy, thanks a lot for your help but im getting this error [B]Warning[/B]: Unexpected character in input: '\' (ASCII=92) state=1 in [B]/home2/webmaste/public_html/ws/submit.php[/B] on line [B]3[/B] [B]Parse error[/B]: syntax error, unexpected T_STRING in [B]/home2/webmaste/public_html/ws/submit.php[/B] on line [B]3[/B] Code (markup): edit that happened when i used wordpad, when i use note pad i got this error
Sorry, I sorda rushed that lol, and I didn't fix a few things... Have one file.... example index.html or index.php <form action="submit.php" method="post"> Code: <input type="text" name="key"> <input type="submit"> </form> HTML: Another file, submit.php <?php if ($_POST["key"]=="123456") header("Location: http://www.mysite.com/allowed.html"); else header("Location: http://www.mysite.com/denied.html"); ?> PHP: The above 2 files exactly as are working for me. Edit: here's my working test: http://www.shock-host.net/test/index.php Edit 2: I also suggest you use Notepad to edit .php files. Wordpad may try to save formatting in the PHP file which servers will not be able to process as PHP.
please check out this one... http://www.webmasterstage.com/test/ this is really weird... that is exactly what i need!! hmmm ... could it be because i uploaded it in a different way i heard there is binary, acid, auto or something like this. or could it be because i used notepad it's making it all in 1 line..?
Have you tried editing it in notepad? If so, on your server rename the submit.php to submit.txt I've tried it under PHP4 and PHP5, and it works under both on my server. Not sure, if not an editor issue, what it could be. Edit: Try the attachment Edit2: I use SmartFTP 2.5 x64 and have my transfer settings on auto.
yes i had PHP version 5.2.5 on that.. i've also tried it on a different hosting www.circassion.com/index.php hmmm.. if you know anyother methods to create the samething please let me know i'm leaving you feedback right now
Hmmm, send me a message on MSN. I'll see if I can help you; it may be an upload issue, is there any other way you can upload the file? (Maybe a control panel or web interface?) MSN: michaelhart [at] michaelhart.me Yahoo: