Redirect not working after making a POST/GET


Posted on 16th Feb 2014 07:03 pm by admin

Hi Everyone,

I am a novice in PHP. Here I have 2 pages, one page with a textbox and button and other page which has code to redirect to another website with the post value as querystring. When I tried to print the post data in the second page after posting, it worked fine, but when I have the header function in the second page the application hangs.

Did you know?Explore Trending and Topic pages for more stories like this.
Below is the code from these pages

First Page
<html>
<body>
<form action="welcome.php" method="get">
Search Phrase: <input type="text" name="fname" />
<input type="submit" />
</form>
</body>
</html>

Second Page

<?php
header( 'Location: http://www.google.com' ) ;
?>

Since I have problem in redirecting, the second page does not have code to pass query string data.

How can I get this working ?

Regards
No comments posted yet

Your Answer:

Login to answer
309 Like 33 Dislike
Previous forums Next forums
Other forums

Setting a default timezone?
I have read about how to change the timezone in PHPMYADMIN, but it changes back, it doesn't STAY the

getting most records by count
Code: [Select]<?php

$connect = mysql_connect("localhost","dam

Is there something wrong?
Hi all,

Just a quick question... can someone look at this code and see if something is wrong?

SWF image using php?
Hello once again.

My latest en devour requires me to produce an image of a static .swf that i

Ten Operator Syntax
Hi Guys,

I can't figure out why i am getting a parse error with this basic ten op code:

Can I use a loop
Hi buddies!

Once again with my doubts here.

Right now I am using this sql stat

onclick problem
I have <input type="text" name="message">
<a href=page2.

Problem with coding MySQL query
I'm having heaps of trouble getting one of my PHP/MySQL queries to work for some reason (and the fun

FROM_UNIXTIME($phpdate);
Hello,

I tried to use this :

$date = FROM_UNIXTIME($phpdate);

ANd I was t

checkbox update
I am having a brain fart right now and i cant remember how to do this. if anyone could help that wou

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash