Krazy-j Posted April 29, 2008 Share Posted April 29, 2008 just ran into a bit of an issue wondering if someone could help out.. ? header("Location: www.urlexample.com/secure/messe...SuccessPage=$url"); Now the only problem with this is it returns the following error message "Warning: Header may not contain more than a single header, new line detected. in C:\wamp\www\login\smsprocess.php on line 25" I have noticed this is due to the fact that $what has new lines? It contains alot of %20's ???? Is there any way to fix this issue? Quote Link to comment Share on other sites More sharing options...
schme16 Posted April 29, 2008 Share Posted April 29, 2008 The only way is to get rid of all the line breaks apparently. you could probably use explode to get rid of them. Like this: <?php $temp_explode = explode(' ', $url); $url = $temp_explode[0]; $temp_explode = NULL; ?> Quote Link to comment Share on other sites More sharing options...
Krazy-j Posted April 29, 2008 Author Share Posted April 29, 2008 hmm, this seems to not work, is there any other way to do this? Quote Link to comment Share on other sites More sharing options...
Fadion Posted April 29, 2008 Share Posted April 29, 2008 I have noticed this is due to the fact that $what has new lines? It contains alot of %20's ???? %20 is the encoded "space". Post the value of the $what or $url variables. Probably ull need to run a str_replace() to remove "\n". Quote Link to comment Share on other sites More sharing options...
mrdamien Posted April 29, 2008 Share Posted April 29, 2008 example of str_replace <?php $chars = array("\n", "\r"); $header = str_replace($chars, "", "Location: www.urlexample.com/secure/messe...SuccessPage={$url}"); header($header); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.