Jump to content

redirect link help


chanfuterboy

Recommended Posts

im busy with register page, everythink is working fine. The html code is on the same page thus after submit it come back in same page to post things in db. What i want is a script that after that it will not show again the register fields instead of that a other page.php help plz

<?php
include("dbconfig.php");


// item register ta kuminsa aki

// prome kos bo tei wak si e port bou nomber di submit mane ta skibi komo nomber dje botton
if(isset($_POST['submit']))

{
// nos tabuta par di variabel ku ta nomber ku ba dune fields nan

$articlename=  $_POST['username'];
$articlecolor=  $_POST['password'];



	{
		// den database
		// na Value ta depende den kuantu table bo ta hinka kos, bo mester buta ('',) den nos kaso tin 8 table den kual e table ku nos ta usa ta 6 7 i 8
		// Sobra tab
		// Sobra table ku no ta wordu usa na value ta keda bashi dor di un parentensis riba nan
		mysql_query("INSERT into users VALUES('','$_POST[username]','$_POST[password]','$pic')");
		echo"$pic";
	}else
	{
		echo "Can't upload. check folder permission";
	}
}



?>

Link to comment
https://forums.phpfreaks.com/topic/180586-redirect-link-help/
Share on other sites

If you're looking to perform a page redirect, you can use the following code:

 

<?php
    if(...) //check if user is logged in
        header('Location: the_page_you_want_to_redirect_to.php') and exit;
?>

 

That code will redirect to the page you specify. You must place this in your script before anything is outputted with echo or print.

Link to comment
https://forums.phpfreaks.com/topic/180586-redirect-link-help/#findComment-952727
Share on other sites

Try this

 

if(!isset($_SESSION["username"])) {
   echo '<meta http-equiv="refresh" content="0;url=collection.php">';
   exit;
}

 

and use mysql_escape_string or mysql_real_escape_string

 

mysql_query("INSERT into users VALUES('','".mysql_real_escape_string($_POST[username])."','".mysql_real_escape_string($_POST[password])."','$pic')");

Link to comment
https://forums.phpfreaks.com/topic/180586-redirect-link-help/#findComment-952804
Share on other sites

Archived

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

×
×
  • Create New...

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.