Mythic Fr0st Posted December 2, 2006 Share Posted December 2, 2006 This is it...its suppost to redirect to http://localhost/Test/Signup.php?error=u2s[code]<?phpif ($_GET['error'] == 'u2s') { echo '<font color="red" size="3"><i>Your username requires atleast 5 characters</i></font>';}?>[/code][code]<?php$minLength=5;function checkLength1($user, $minLength){ if (strlen($user) < $minLength) { return false; } else { return true; }}if (!checkLength1($_POST['user'], 4)){ header("location: http://localhost/Test/Signup.php?error=u2s");}?>[/code]the header thing suppost to redirect to that error page...But I get these errors too[code]Notice: Undefined index: error in c:\program files\easyphp1-8\www\test\signup.php on line 22Notice: Undefined index: error in c:\program files\easyphp1-8\www\test\signup.php on line 28Notice: Undefined index: error in c:\program files\easyphp1-8\www\test\signup.php on line 34Notice: Undefined index: error in c:\program files\easyphp1-8\www\test\signup.php on line 40Notice: Undefined index: error in c:\program files\easyphp1-8\www\test\signup.php on line 46[/code]AND these[code]Notice: Undefined index: user in c:\program files\easyphp1-8\www\test\signup.php on line 104Warning: Cannot modify header information - headers already sent by (output started at c:\program files\easyphp1-8\www\test\signup.php:4) in c:\program files\easyphp1-8\www\test\signup.php on line 106Notice: Undefined index: pw1 in c:\program files\easyphp1-8\www\test\signup.php on line 124Warning: Cannot modify header information - headers already sent by (output started at c:\program files\easyphp1-8\www\test\signup.php:4) in c:\program files\easyphp1-8\www\test\signup.php on line 126Notice: Undefined index: pw2 in c:\program files\easyphp1-8\www\test\signup.php on line 144Notice: Undefined variable: pw2 in c:\program files\easyphp1-8\www\test\signup.php on line 134Warning: Cannot modify header information - headers already sent by (output started at c:\program files\easyphp1-8\www\test\signup.php:4) in c:\program files\easyphp1-8\www\test\signup.php on line 146Notice: Undefined index: pw1 in c:\program files\easyphp1-8\www\test\signup.php on line 154Notice: Undefined index: pw2 in c:\program files\easyphp1-8\www\test\signup.php on line 154Warning: Cannot modify header information - headers already sent by (output started at c:\program files\easyphp1-8\www\test\signup.php:4) in c:\program files\easyphp1-8\www\test\signup.php on line 163Notice: Undefined index: email1 in c:\program files\easyphp1-8\www\test\signup.php on line 172Notice: Undefined index: email2 in c:\program files\easyphp1-8\www\test\signup.php on line 172Warning: Cannot modify header information - headers already sent by (output started at c:\program files\easyphp1-8\www\test\signup.php:4) in c:\program files\easyphp1-8\www\test\signup.php on line 181[/code]why cant I modify header info, whats it mean?, and how do I fix this Link to comment https://forums.phpfreaks.com/topic/29196-redirect-not-working-in-my-code-why-not/ Share on other sites More sharing options...
fert Posted December 2, 2006 Share Posted December 2, 2006 you can only use the header function at the very top of your source code us this instead:[code]function Redirect($time, $topage) {echo "<meta http-equiv=\"refresh\" content=\"{$time}; url={$topage}\" /> ";}[/code]and the undefined index one means that an array contains an index name that doesn't exists. Link to comment https://forums.phpfreaks.com/topic/29196-redirect-not-working-in-my-code-why-not/#findComment-133863 Share on other sites More sharing options...
Mythic Fr0st Posted December 2, 2006 Author Share Posted December 2, 2006 I know that, but I cant change that, because like, they dont exist yet, or something i dunno -.-Could you do me a big favour, and errjust put it into text, I dont understand that,I have other things, and I dont know if to delete them, or what i dunno O_O Link to comment https://forums.phpfreaks.com/topic/29196-redirect-not-working-in-my-code-why-not/#findComment-133865 Share on other sites More sharing options...
fert Posted December 2, 2006 Share Posted December 2, 2006 an undefined index means that a variable like $_POST[index] doesn't exist Link to comment https://forums.phpfreaks.com/topic/29196-redirect-not-working-in-my-code-why-not/#findComment-133866 Share on other sites More sharing options...
Mythic Fr0st Posted December 2, 2006 Author Share Posted December 2, 2006 I know, but look at this for example, I cant remove em[code]mail($_POST['email1'],$subject,$msg,$headers);[/code] the ['email1'] doesnt exist on this pagebut on signup page, when you click signup, it goes here, and email's to you, email1 is the name, of the text box, that they put their e-mail in, how else can I do it, so I dont have the "Notice undefined index thing", I got no idea, considering I have 30 on my homepage ( can these be seen by others ?! ) Link to comment https://forums.phpfreaks.com/topic/29196-redirect-not-working-in-my-code-why-not/#findComment-133868 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.