Jump to content
php.lv forumi

redirect uz citu lapu


urramingash

Recommended Posts

Kods shitaads:

 

if ($error == 0){
//ja nav OK
echo $errorLog;
 header("Location: register.php");
 exit();
}
else{
echo 'Viss OK, pienjemu registraciju.';
}

 

Bet man nobljaujas, ka nav labi ar to headeru, ka already sent.

 

un to $errorLog maniigo vajag nosuutiit arii uz register.php (tjipa atpakalj, jo register.php izsauc shito kodu)

Link to comment
Share on other sites

OK, tiek radiits mainiigais, ko vajag paarsuutiit atpakalj uz to ragister.php

 

Kaa shito dabuut gatavu?

 

Lai ieksh register.php vinju vareetu nolasiit kaa $_POST['atsuutiitaismainiigais'].

 

Mosh savaadak ir labaak?

 

man to $errorLog vajag aizuutiit uz register.php

 

Varbuut tiaki caur cookies to var dabuut gatavu? Man neder ar register.php?errorLog=4

Edited by urramingash
Link to comment
Share on other sites

Viss OK, salaboju, sataisiiju. Ja nu gadiijumaa citiem chainjikiem rodas shaadas probleemas, tad nu reku risinajums maneejais shaads:

 

<?php

if($HTTP_POST_VARS['Submit']) {
if ((!$HTTP_POST_VARS['vards'] || 
!$HTTP_POST_VARS['uzvards'] ||
     //blablabla
   {
 //pieregistree, jo visi laukumi aizpildiiti
 $errorLog = "Reģistrācija veiksmīga!<BR> <a href=\"index.php\" class=\"LinkUnderlined style4\">Uz sākuma lapu</a>";
}
echo $errorLog;

 

Nu re, nebij nemaz tik briesmiigi, vajag paseerchot... googli.

Link to comment
Share on other sites

×
×
  • Create New...