Jump to content

Archived

This topic is now archived and is closed to further replies.

therock

page redirect

Recommended Posts

hi all,
i'm new to this forum awa to php.

can someone help me
i want to redirect to some other php page on a button click.

i used this code, but it doesn't work

$URL="http://www.example.com";

header ("Location: $URL");

is there anythin like redirect("");

Share this post


Link to post
Share on other sites
So why not use html .... <a href="http://www.example.com">click here</a>

Share this post


Link to post
Share on other sites
hi andy,
i'm gettin datas from users usin a form(getdata.php) and insertin it into a table(insertdata.php).

wen datas r inserted the page (insertdata.php) remains.

wat i need is to redirect it to (getdata.php) again after insertion is over.

Share this post


Link to post
Share on other sites
As long as you have no output to the browser in insertdata,php, you can use the header() function:

[code]<?php
// insertdata.php

// retrieve data from form
// conn to database, select database
// create and execute db query

header("Location: getdata.php");
?>[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.