PHP passing a variable with header redirect(should be simple)
<p>So as the thread subj suggests, im trying to pass a variable within a header link.
not sure if im doing it right although at first glance, i think i am...anyways so</p>

<p>long story short, i want to put in an error page that lets the user know what they did wrong, php validating i suppose although, this time i thought id add a nice/funny mssg since the app im building is for friends...anyways so</p>

<p>i made this dummy code to illustrate what i mean....(and still doesnt work lol)</p>

<p>when i do this</p>

<p>PHP:</p>

<pre><code>$name = "mike";

if($name != "lopan"){
        header("Location:error-page.php?$errorMssg=Waoo so your not EVEN going to try to enter information huh?");
}
</code></pre>

<p>the page goes through but doesnt pass the variable that contains the message.</p>

<p>when i create a simple link with values like this:</p>

<pre><code>&lt;a href="error-page.php?$errorMssg=so what happened there buddy?"&gt;link&lt;/a&gt;
</code></pre>

<p>it passes it just fine.</p>

<p>Any ideas what im doing wrong??? or can i not pass in information with headers???</p>

<p>PS, i saw two similar threads and although related(one of em more so than the other) theyre passing in way much more information than i so i cant figure it out...this should be simple.</p>

<p>Thanks in advanced.</p>
