MixedUpCody's Profile User Rating: -----

Reputation: 1 Apprentice
Group:
Members
Active Posts:
34 (0.07 per day)
Joined:
24-December 11
Profile Views:
355
Last Active:
User is offline Nov 28 2012 08:07 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   MixedUpCody Awesome

Posts I've Made

  1. In Topic: PHP Header Redirect Issue

    Posted 28 Nov 2012

    Okay, that makes sense. Whew! PHP has a lot of gotchas. Thanks, all.

    Cody
  2. In Topic: PHP Header Redirect Issue

    Posted 27 Nov 2012

    Oh. Why is breaking the connection to re-direct not ideal?
  3. In Topic: PHP Header Redirect Issue

    Posted 26 Nov 2012

    Okay, I got it working. Thank you so much for all of your help. You all are the best.

    Cody

    <?php
    	if(isset($_GET["name"])){
    		test();
    	}	
    	function test(){
    		$name = strtolower($_GET["name"]);
    		if ($name=="whorf" || $name=="sapir"){
    		header("Location: correct.html");
    		}else{
    		header("Location: incorrect.html");
    		}
    	}
    ?>
    <!DOCTYPE html>
    <html lang="en">
    	<head>
    		<meta charset="utf-8">
    		<title>Test</title>
    	</head>
    	<body>
    		<p>Now, we must verify that you are, indeed, a linguist!</p>
    		<br />
    		<p>What is the last name of the linguist most associated with the Linguistic Determinism hypothesis?</p>		
    		<form>
    			<input type="text" name="name"><br />
    			<input type="submit" text="submit"/>
    		</form>
    	</body>
    </html>
    
    
  4. In Topic: PHP Header Redirect Issue

    Posted 26 Nov 2012

    CTphpnweb,

    The whole point was to test the user's input and then redirect them to the appropriate page depending on their response. I originally had the php after the input form, and that worked fine on my lamp server, but when I uploaded it to the site it stopped working.
  5. In Topic: PHP Header Redirect Issue

    Posted 26 Nov 2012

    laytonsdad and Dormilich, thank you very much! I got past that problem. But now, it redirects to "incorrect.html" automatically without giving the user a chance to fill out the input form. I know this is because it is evaluating the PHP before it gets to the HTML, but I can't figure out the solution. I had it working on my local host just fine, but now it won't function the way I want. Any ideas? Sorry I have so many questions, I've never used PHP before. Thanks again.

    Cody

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Click here to e-mail me

Friends

Comments

MixedUpCody has no profile comments yet. Why not say hello?