Forum Moderators: coopster

Message Too Old, No Replies

redirect user to another webpage

redirect user to another webpage

         

rainmaker32

8:25 pm on Nov 23, 2005 (gmt 0)

10+ Year Member



Sorry I a php nob :)
When a user inputs a "topic" into our form I want to redirect them to another webpage. Everytime a user inputs something into our form, the browser tries to download the script instead of execute it. I am not sure what is going on.

Here is the form:
<form action="/cgi-bin/search.php" method="GET" >
<input type="text" name="keyword" size="15" />
</form>

Here is search.php:
#!/usr/local/php/bin/php
header('Location: [somewhereelse.org');...]

**misc info
the script perms are 755
AddHandler cgi-script .cgi .php
AddType application/x-httpd-php .php .html .cgi

I maybe using the wrong approach, any ideas are very welcome.

coopster

3:19 pm on Nov 24, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, rainmaker32.

So your PHP installation is setup as CGI as opposed to server module? Seems the configuration is off then, the server hasn't been instructed to parse that extension correctly. Have you double-checked your Installation [php.net]?

rainmaker32

3:40 pm on Nov 25, 2005 (gmt 0)

10+ Year Member



Thanks for the reply.

I do have php set up through apache as well(And it works). I just wasn't sure how to get it to do what I was wanting it to do without a cgi.

coopster

8:52 pm on Nov 28, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I'm not sure I understand the issue here yet. Is the server setup as module or cgi? You have a shebang line in your "search.php" script which leads me to believe you have the server setup as CGI...

whoisgregg

1:04 am on Nov 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I had the same problem on a web host where PHP was installed as a CGI module. After *many* different attempts, this was the line that fixed it, try it in your .htaccess:

AddHandler php3-script .php .html .cgi