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.

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

Changing color in GD via variable?
Hey guys, I'm new here. x)

I'm very much a noob when it comes to PHP, but I'm trying to learn

IF Statement & Two Tables With Different Echoes
I'm retrieving two tables in a single query using UNION ALL, like so:

Code: $query = "SE

Needing Youtube thumb nail fix.
I have a script on a site that pulls in you-tube videos,
The problem is, that the thumb nails for

Storing the referrer in session... problems with tabs
Hello All

I am currently working on an ERP project based on the MVC methodology, when a user

Are sessions secure at all?..
I haven't really gotten into yet, but I was just thinking of something weird..

Lets say you h

Stopping page post back
I have few literal contriols in my page and a repeater too. But inspite of using update panel, postb

animation progress while uploading files?
Hello, i have some website form to upload few files to server. i want to put some gif animation whi

PHP onsubmit in the form not going to the fuction.
I have a form through ‘onsubmit’ calling a function validation(). But not going to the

Multiple upload and Resize
I would like some help on my script I have the for my index.php

////

<html&

frames get header location..
i have two frames, one top, one bottom. how do i do a form on the bottom frame that gives me the ur

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