bulgaria_mitko Posted January 12, 2007 Share Posted January 12, 2007 ok i need some help i have this situation when someone enter a page call products_2.php he need to have access to this page what i mean is that the user need to login before he can enter products_2.php i have the code to send them to login.php if the user is not login and everything is working great, but i want i code that when the person hit a site products_2.php or products_3.php or whatever and when he login successfully i want to directly send them to the page he wanted to visit and not to send them to index.php because right now it is sending the user when he login to index.php and he need again to navigate to products_2.php can u get me what i mean?I'm using some code in login.php but its not working its sending the user again back to index.php:[code]<?phpob_start();// *** Validate request to login to this site.if (!isset($_SESSION)) { session_start();}$loginFormAction = $_SERVER['PHP_SELF'];if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck'];}?>[/code] Quote Link to comment Share on other sites More sharing options...
bulgaria_mitko Posted January 12, 2007 Author Share Posted January 12, 2007 can someone help me pls? Quote Link to comment Share on other sites More sharing options...
play_ Posted January 12, 2007 Share Posted January 12, 2007 In login.php, get the url the user just came from. (say it's products_2.php)after he logs in, redirect him to the url the user came from (say it's products_2.php) Quote Link to comment Share on other sites More sharing options...
bulgaria_mitko Posted January 12, 2007 Author Share Posted January 12, 2007 i get the idea but i don't know the code i should write in order to succeed, I'm still learning can u give some php code? thank you very much! Quote Link to comment Share on other sites More sharing options...
play_ Posted January 12, 2007 Share Posted January 12, 2007 try $_SERVER['referer_url'] Quote Link to comment Share on other sites More sharing options...
bulgaria_mitko Posted January 14, 2007 Author Share Posted January 14, 2007 it dosent work with this code can someone pls help me!!!! i will post the codes for every page i have so someone can help me i hopeproducts_v2.php:[code]<?phpif (!isset($_SESSION['user'],$_SESSION['pass'],$_SESSION['name'],$_SESSION['town'],$_SESSION['adress'],$_SESSION['tel'],$_SESSION['mail'])) { echo '<script language=JavaScript>window.location.href="index.php?page=users/login_register"</script>'; exit();}$menu = $_GET["product"];$type1 = $_GET["type1"];$type2 = $_GET["type2"];$type3 = $_GET["type3"];$name = $_GET["name"];if (!isset($_GET["session"])) { $session = rand(1,999999);} else { $session = $_GET["session"];}$result_product = mysql_query("SELECT *FROM `products`WHERE `menu`='$menu' AND `type1`='$type1' AND `type2`='$type2' AND `type3`='$type3' AND `name` LIKE '$name'LIMIT 1");$br_pr = 0;while ($row = mysql_fetch_object($result_product)) { $br_pr++; $menu = $row-> menu; $img = $row-> img; $type[1] = $row-> type1; $type[2] = $row-> type2; $type[3] = $row-> type3; $name = $row-> name; $price[1] = $row-> price1; $price[2] = $row-> price2; $price[3] = $row-> price3; $price[4] = $row-> price4; $price[5] = $row-> price5; $price[6] = $row-> price6; $price[7] = $row-> price7; $price[8] = $row-> price8; $price[9] = $row-> price9; $price[10] = $row-> price10; $price_info[1] = $row-> price1_info; $price_info[2] = $row-> price2_info; $price_info[3] = $row-> price3_info; $price_info[4] = $row-> price4_info; $price_info[5] = $row-> price5_info; $price_info[6] = $row-> price6_info; $price_info[7] = $row-> price7_info; $price_info[8] = $row-> price8_info; $price_info[9] = $row-> price9_info; $price_info[10] = $row-> price10_info; $info[1] = $row-> info1; $info[2] = $row-> info2; $info[3] = $row-> info3; $info[4] = $row-> info4; $info[5] = $row-> info5; $enter[1] = $row-> enter1; $enter[2] = $row-> enter2; $enter[3] = $row-> enter3; $enter[4] = $row-> enter4; $enter[5] = $row-> enter5; $enter[6] = $row-> enter6; $enter[7] = $row-> enter7; $enter[8] = $row-> enter8; $enter[9] = $row-> enter9; $enter[10] = $row-> enter10; $enter[11] = $row-> enter11; $enter[12] = $row-> enter12; $enter[13] = $row-> enter13; $enter[14] = $row-> enter14; $enter[15] = $row-> enter15; $enter[16] = $row-> enter16; $enter[17] = $row-> enter17; $enter[18] = $row-> enter18; $enter[19] = $row-> enter19; $enter[20] = $row-> enter20; $enter[21] = $row-> enter21; $enter[22] = $row-> enter22; $enter[23] = $row-> enter23; $enter[24] = $row-> enter24; $enter[25] = $row-> enter25;}if ($br_pr == 0) { echo '<script language=JavaScript>window.location.href="index.php?page=error_login&error=Не e открит подобен артикул.&back=home"</script>'; exit();}$result_product_menu = mysql_query("SELECT * FROM `menu` WHERE `menu_name` = '$menu' LIMIT 1");while ($row = mysql_fetch_object($result_product_menu)) { $inf = $row-> menu_information; $pro = $row-> menu_promotion; $procent = $row-> menu_procent;}if ( $img == "" ) { $img = "noproview.jpg";}?><html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"><title>Печатница "НИМА"</title><link href="css.css" rel="stylesheet" type="text/css"><style type="text/css"><!--.style12 {color: #FFFFFF}--></style></head><body><div align="center"> <table width="548" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="30"><div align="center"><strong>Настройки и регистриране на поръчката : </strong></div></td> </tr> <tr> <td height="20" bgcolor="#9DCEFF"><div align="center" class="style12"><strong>Вид : <?php echo "$menu"; ?> | Tип : <?php echo "$name"; ?></strong></div></td> </tr> </table> <table width="548" border="0" cellspacing="0" cellpadding="0"> <tr> <td><div align="center"> <table width="545" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td rowspan="2"><div align="center"> <?php for ( $i = 1 ; $i <= 5 ; $i++ ) { if ($info["$i"] != "") { echo ' <table width="240" border="1" cellpadding="0" cellspacing="1" bordercolor="#FFFFFF" class="BlockTextSmall"> <tr> <td bordercolor="#CCCCCC"> '.$info["$i"].' </td> </tr> </table> '; } } for ( $i = 1 ; $i <= 10 ; $i++ ) { if ($price["$i"] != "") { echo ' <table width="240" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" class="BlockTextSmall"> <tr> <td bgcolor="#E0E0E0"><div align="center">Цена '.$price["$i"].'лв. ('.$price_info["$i"].') </div></td> </tr> </table>'; } } ?></div></td> <td width="300"><div align="center" class="BlockTextSmall">Образец : </div></td> </tr> <tr> <td><div align="center"><a href="products/<?php echo "$img"; ?>" title="Изглед" target="_blank"><img src="view2.php?url=products/<?php echo "$img"; ?>" border="0" /></a></div></td> </tr> </table> </div></td> </tr> </table> <form action="index.php?page=products_v3&product=<?php echo "$menu"; ?>&type1=<?php echo "$type1"; ?>&type2=<?php echo "$type2"; ?>&type3=<?php echo "$type3"; ?>&name=<?php echo "$name"; ?>&session=<?php echo "$session"; ?>" method="post" enctype="multipart/form-data" name="form1"> <table width="545" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#B1D8FF"> <tr> <td> <span class="BlockTextSmall">Тук можете сами да съставите съдържанието на Вашите <?php echo "$menu"; ?> (ако артикула позволява). За целта въведете необходимите данни в долната форма.</span></td> </tr> <tr> <td> <?php $views = 1; for ( $i = 1 ; $i <= 10 ; $i++ ) { if ( $enter["$i"] != "" ) { if ( $views == 1 ) { echo ' <table width="535" border="0" align="center" cellpadding="0" cellspacing="0"> <tr bgcolor="#9DCEFF"> <td width="50%" height="20"><div align="center" class="style12"><strong>Текст</strong></div></td> <td height="20"><div align="center" class="style12"><strong>Шрифт</strong></div></td> </tr> </table>'; $views = 2; } echo ' <table width="535" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="50%"><div align="center"> <input name="enter'.$i.'" type="text" class="BlockTextSmall" id="enter'.$i.'" value="'.$enter["$i"].'" size="40"> </div></td> <td width="50%"><div align="center"> <select name="font'.$i.'" class="BlockTextSmall" id="font'.$i.'"> <option selected>Timok</option> <option>Timok Italic</option> <option>Timok Bold</option> <option>Timok Bold Italic</option> <option>Hebar</option> <option>Hebar Italic</option> <option>Hebar Bold</option> <option>Hebar Bold Italic</option> <option>HebarCond</option> <option>HebarCond Italic</option> <option>HebarCond Bold</option> <option>HebarCond Bold Italic</option> <option>Sentry</option> <option>Sentry Italic</option> <option>Sentry Bold</option> <option>Sentry Bold Italic</option> <option>SentryCond</option> <option>SentryCond Italic</option> <option>SentryCond Bold</option> <option>SentryCond Bold Italic</option> <option>Balkan</option> <option>Balkan Italic</option> <option>Balkan Bold</option> <option>Balkan Bold Italic</option> <option>Karina</option> <option>Karina Italic</option> <option>Karina Bold</option> <option>Karina Bold Italic</option> <option>Breeze</option> <option>Breeze Bold</option> <option>Fiesta</option> <option>Helen</option> <option>Helen Italic</option> <option>Helen Bold</option> <option>Helen Bold Italic</option> </select> </div></td> </tr> </table> '; } } ?> <?php for ( $i = 11 ; $i <= 20 ; $i++ ) { if ( $enter["$i"] != "" ) { echo ' <table width="500" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="40%"><div align="right">'.$enter["$i"].' : </div></td> <td> <div align="left"> <input name="enter'.$i.'" type="text" class="BlockTextSmall" id="enter'.$i.'" size="40"> </div></td></tr> </table> '; } } ?> <?php $views = 1; for ( $i = 21 ; $i <= 24 ; $i++ ) { if ( $enter["$i"] != "" ) { if ( $views == 1 ) { echo ' <table width="535" border="0" align="center" cellpadding="0" cellspacing="0"> <tr bgcolor="#9DCEFF"> <td width="30%" height="20"><div align="center" class="style12"><strong>Текст</strong></div></td> <td width="30%" height="20"><div align="center" class="style12"><strong>Шрифт</strong></div></td> <td width="20%" bgcolor="#9DCEFF" class="style12"><div align="center"><strong>Размер</strong></div></td> <td width="20%" class="style12"><div align="center"><strong>Позиция</strong></div></td> </tr> </table> '; $views = 2; } echo ' <table width="535" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="30%"> <div align="center"> <input name="enter'.$i.'" type="text" class="BlockTextSmall" id="enter'.$i.'" value="'.$enter["$i"].'" size="25"> </div></td> <td width="30%"><div align="center"> <select name="font'.$i.'" class="BlockTextSmall" id="font'.$i.'"> <option>Timok</option> <option>Timok Italic</option> <option>Timok Bold</option> <option>Timok Bold Italic</option> <option selected>Hebar</option> <option>Hebar Italic</option> <option>Hebar Bold</option> <option>Hebar Bold Italic</option> <option>HebarCond</option> <option>HebarCond Italic</option> <option>HebarCond Bold</option> <option>HebarCond Bold Italic</option> <option>Sentry</option> <option>Sentry Italic</option> <option>Sentry Bold</option> <option>Sentry Bold Italic</option> <option>SentryCond</option> <option>SentryCond Italic</option> <option>SentryCond Bold</option> <option>SentryCond Bold Italic</option> <option>Balkan</option> <option>Balkan Italic</option> <option>Balkan Bold</option> <option>Balkan Bold Italic</option> <option>Karina</option> <option>Karina Italic</option> <option>Karina Bold</option> <option>Karina Bold Italic</option> <option>Breeze</option> <option>Breeze Bold</option> <option>Fiesta</option> <option>Helen</option> <option>Helen Italic</option> <option>Helen Bold</option> <option>Helen Bold Italic</option> </select> </div></td> <td width="20%"><div align="center"> <select name="size'.$i.'" class="BlockTextSmall" id="size'.$i.'"> <option selected>9</option> <option>10</option> <option>11</option> <option>12</option> <option>13</option> <option>14</option> <option>15</option> <option>16</option> <option>17</option> <option>18</option> <option>19</option> <option>20</option> </select> </div></td> <td width="20%"><div align="center"> <select name="hor'.$i.'" class="BlockTextSmall" id="hor'.$i.'"> <option selected>ляво</option> <option>център</option> <option>дясно</option> </select> <select name="ver'.$i.'" class="BlockTextSmall" id="ver'.$i.'"> <option selected>горе</option> <option>средно</option> <option>долу</option> </select> </div></td> </tr> </table> '; } } ?> <?php if ( $enter[25] == "да" ) { echo ' <table width="535" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="20" bgcolor="#9DCEFF" class="style12"><div align="center"><strong>Изпращане на файл (снимка)</strong></div></td> </tr> </table> <table width="535" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="40%" height="30" class="BlockTextSmall"> <div align="center">Качване на файл (jpg до 300 кб) : </div></td> <td><div align="center"> <input name="enter25" type="file" class="BlockTextSmall" id="enter25" size="35"> </div></td> </tr> </table> '; } unset($i); ?> </td> </tr> </table> <table width="535" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC"> <tr> <td><div align="center">Плащане по : <select name="pay_way" class="BlockTextSmall" id="pay_way"> <option>Банков път</option> <option selected>Наложен платеж</option> </select> </div></td> </tr> </table> <table width="535" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC"> <tr> <td height="60"><div align="center"> <select name="the_price" class="BlockTextSmall" id="the_price"> <?php for ( $i = 1 ; $i <= 10 ; $i++ ) { if ($price["$i"] != "") { if ( $i == 1 ) { echo '<option value="'.$price["$i"].'" selected>'.$price["$i"].' лв: '.$price_info["$i"].'</option>'; } else { echo '<option value="'.$price["$i"].'">'.$price["$i"].' лв: '.$price_info["$i"].'</option>'; } } } ?> </select> <?php if (isset($procent)) { if ( $procent != "" ) { echo ' <table width="200" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="center"><span class="style13">ОТСТЪПКА : '.$procent.'%</span></div></td> </tr> </table>'; } } ?> </div></td> <td width="30%" bgcolor="#FFCC00"><div align="center"> <input name="Submit" type="submit" class="BlockTextNormal" value="ПОРЪЧАЙ"> </div></td> </tr> </table> <table width="535" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="30"><div align="center"> <a href="http://www.econt.com/Econt_Net/Main.aspx" target="_blank"><strong>Доставка от врата до врата в зависимост от теглото! EcontExpress</strong></a></div></td> </tr> <tr> <td height="30"><div align="center" class="BlockTextSmall"><em>Всички цени са без ДДС. </em></div></td> </tr> </table> </form></div></body></html>[/code]login_registration.php:[code]<?phpob_start();// *** Validate request to login to this site.if (!isset($_SESSION)) { session_start();}$loginFormAction = $_SERVER['PHP_SELF'];if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck'];}?><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"><title>Печатница "НИМА"</title><link href="../css.css" rel="stylesheet" type="text/css"><style type="text/css"><!--.style1 {color: #FF0000}--></style><script language="JavaScript" type="text/JavaScript"><!--function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x;}function MM_validateForm() { //v4.0 var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- полето '+nm+' трябва да съдържа валиден mail адрес.\n'; } else if (test!='R') { num = parseFloat(val); if (isNaN(val)) errors+='- '+nm+' must contain a number.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n'; } } } else if (test.charAt(0) == 'R') errors += '- изисква се полето '+nm+'.\n'; } } if (errors) alert('Иткрити са следните грешки:\n'+errors); document.MM_returnValue = (errors == '');}//--></script></head><body><div align="center"> <table width="548" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="center"><img src="images/login.jpg" width="550" height="50"></div></td> </tr> <tr> <td height="30"><div align="center"><em>Моля въведете изискваната информация : </em></div> </td> </tr> <tr> <td> <form name="form1" method="post" action="index.php?page=users/ident"> <table width="540" border="0" align="center" cellpadding="0" cellspacing="2"> <tr> <td width="220"><div align="right">Потребител : </div></td> <td><input name="потребител" type="text" class="BlockTextNormal" id="потребител" size="25"></td> </tr> <tr> <td width="220"><div align="right">Парола : </div></td> <td><input name="парола" type="password" class="BlockTextNormal" id="парола" size="25"></td> </tr> </table> <table width="100" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="center"> <input name="Submit" type="submit" class="Thabutton" value="Вход"> </div></td> </tr> </table> </form></td> </tr> <tr> <td class="BlockTextSmall"><div align="right">Възникнал е проблем ? </div></td> </tr> <tr> <td class="BlockTextSmall"><div align="right"><a href="index.php?page=users/lost_pass">Забравена парола</a> </div></td> </tr> <tr> <td class="BlockTextSmall"><div align="right"><a href="index.php?page=users/help">Помощ</a></div></td> </tr> </table></div> <form action="index.php?page=users/signup_proceed" method="post" enctype="multipart/form-data" name="form1"> <table width="545" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="center"><img src="images/register2.jpg" width="550" height="50"></div></td> </tr> <tr> <td height="25"><div align="center"><strong>Въведете изискваната информация. Всички полета са задължителни ! </strong></div></td> </tr> </table> <table width="530" border="0" align="center" cellpadding="0" cellspacing="2"> <tr> <td width="200" rowspan="2"><div align="right">Потребителско име (прякор) : </div></td> <td><input name="потребител" type="text" class="BlockTextNormal" id="потребител" size="35" maxlength="15"> </td> </tr> <tr> <td class="BlockTextSmall">има значение малки и главни букви (макс. 15 символа) </td> </tr> <tr> <td><div align="right">Вашите имена : </div></td> <td><input name="име" type="text" class="BlockTextNormal" id="име" size="35"></td> </tr> <tr> <td rowspan="2"><div align="right">Парола : </div></td> <td><input name="парола1" type="password" class="BlockTextNormal" id="парола1" size="35" maxlength="15"> </td> </tr> <tr> <td><span class="BlockTextSmall">има значение малки и главни букви (макс. 15 символа) </span></td> </tr> <tr> <td><div align="right">Парола (повтори) : </div></td> <td><input name="парола2" type="password" class="BlockTextNormal" id="парола2" size="35"> </td> </tr> <tr> <td><div align="right">Електронен адрес (email) : </div></td> <td><input name="мейл" type="text" class="BlockTextNormal" id="мейл" size="35"> </td> </tr> <tr> <td><div align="right">Точен адрес (за доставка) : </div></td> <td><input name="адрес" type="text" class="BlockTextNormal" id="адрес" size="35"> </td> </tr> <tr> <td><div align="right">Град (за доставка) : </div></td> <td><input name="град" type="text" class="BlockTextNormal" id="град" size="35"> </td> </tr> <tr> <td><div align="right">Телефон за контакти :</div></td> <td valign="middle">+359 <select name="код" class="BlockTextNormal" id="код"> <option value="885" selected >0885 МТел</option> <option value="886" >0886 МТел</option> <option value="887" >0887 МТел</option> <option value="888" >0888 МТел</option> <option value="889" >0889 МТел</option> <option value="898" >0898 Глобул</option> <option value="БТК" >БТК</option> </select> <input name="телефон" type="text" class="BlockTextNormal" id="телефон" size="20"></td> </tr> <tr> <td colspan="2"><div align="center"> <textarea name="textfield" cols="50" rows="6" wrap="VIRTUAL" class="BlockTextNormal">ОБЩИ УСЛОВИЯ НА "ПЕЧАТНИЦА НИМА" ООДПредварително условие:Ние си запазваме правото да не приемем поръчки със следното съдържание:- расистко- сексистко- нацистко- такова, което накърнява достойнствата на малцинстватаили такова, което накърнява основните човешки права на гражданите.Също така си запазваме правото да не изпълним поръчки от организации, които по някакъв начин са свързани с дейностите посочени по-горе.I. Авторско правоПри поръчка от наш клиент, ние изхождаме от това, че той е носител на съответните авторски права.Всички поръчки се приемат при условие, че клиентът поема отговорността за съответните авторски права, като ние се освобождаваме от всякаква отговорност.II. ЗаплащанеПоръчки се изпълняват след заплащане в брой или по сметка. Всякакви други условия могат да бъдат договорени само лично с клиента.При несъответствие на получател на стоката и получател на сметката двамата отговарят за заплащането солидарно.III. Място на получаване и доставкаНашите цени са цени при получаване на място. При доставка се добавя допълнителна такса съобразно изискванията на нашите партньори.IV. Свободно въвеждане на данни от клиентаПри поръчка клиентът носи цялата отговорност за верността на данните въведени от него. Това важи и за допуснати правописни или пунктуационни грешки. </textarea></div></td> </tr> <tr> <td colspan="2"><div align="left"> <input name="условия" type="checkbox" id="условия" value="да" checked> Приемам Общите условия</div></td> </tr> <tr> <td colspan="2"> <input name="информация" type="checkbox" id="информация" value="да" checked> Желая да получавам информация от www.nima.bg (оферти, новоприбавени продукти и друго)</td> </tr> <tr bgcolor="#9BCDFF"> <td height="30" colspan="2"><div align="center"> <input name="Submit" type="submit" class="Thabutton" onClick="MM_validateForm('потребител','','R','име','','R','парола1','','R','парола2','','R','мейл','','RisEmail','адрес','','R','град','','R','телефон','','R');return document.MM_returnValue" value="Регистрирай ме!"> </div></td> </tr> <tr bgcolor="#9BCDFF"> <td height="30" colspan="2"><div align="center">Вашата персонална информация ще бъде защитена и конфиденциална.</div></td> </tr> </table></form></body></html>[/code]ident.php:[code]<?phpif (isset($_POST['потребител'],$_POST['парола'])) { $user = $_POST['потребител']; $pass = $_POST['парола'];} if (isset($user,$pass)) { include "sql.php"; mysql_connect("$sql_host", "$sql_user_name", "$sql_user_pass"); mysql_select_db("$sql_database"); $login = mysql_query("SELECT * FROM users WHERE `user`='$user' AND `pass`='$pass' LIMIT 1"); while ($row = mysql_fetch_object($login)) { $user = $row -> user; $pass = $row -> pass; $name = $row -> name; $town = $row -> town; $adress = $row -> adress; $tel = $row -> tel; $mail = $row -> mail; $tel_type = $row -> tel_type; } if (isset($user,$pass,$name,$adress,$tel,$mail)) { $_SESSION['user'] = $user; $_SESSION['pass'] = $pass; $_SESSION['name'] = $name; $_SESSION['town'] = $town; $_SESSION['adress'] = $adress; $_SESSION['tel'] = $tel; $_SESSION['tel_type'] = $tel_type; $_SESSION['mail'] = $mail;}}?><div align="center"><?php if (!isset($_SESSION['user'],$_SESSION['pass'],$_SESSION['name'],$_SESSION['town'],$_SESSION['adress'],$_SESSION['tel'],$_SESSION['mail'])) { echo '<table width="548" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td height="30"><div align="center"> <p><em>Грешно потребителско име или парола.</em></p> </div></td> </tr> <tr> <td><div align="center"><a href="index.php?page=users/login">Назад</a></div></td> </tr> </table> ';& Quote Link to comment Share on other sites More sharing options...
bulgaria_mitko Posted January 14, 2007 Author Share Posted January 14, 2007 someone, pls!!! :-[ :-[ :-[ :-[ :-[ :-[ :-[ :-[ :'( :'( :'( :'( :-\ :-\ :-\ :-\ Quote Link to comment Share on other sites More sharing options...
bulgaria_mitko Posted January 17, 2007 Author Share Posted January 17, 2007 can someone pls help me? Quote Link to comment Share on other sites More sharing options...
bulgaria_mitko Posted January 17, 2007 Author Share Posted January 17, 2007 ident.php[code]<?phpif (isset($_POST['потребител'],$_POST['парола'])) { $user = $_POST['потребител']; $pass = $_POST['парола'];}if (isset($user,$pass)) { include "sql.php"; mysql_connect("$sql_host", "$sql_user_name", "$sql_user_pass"); mysql_select_db("$sql_database"); $login = mysql_query("SELECT * FROM users WHERE `user`='$user' AND `pass`='$pass' LIMIT 1"); while ($row = mysql_fetch_object($login)) { $user = $row -> user; $pass = $row -> pass; $name = $row -> name; $town = $row -> town; $adress = $row -> adress; $tel = $row -> tel; $mail = $row -> mail; $tel_type = $row -> tel_type; } if (isset($user,$pass,$name,$adress,$tel,$mail)) { $_SESSION['user'] = $user; $_SESSION['pass'] = $pass; $_SESSION['name'] = $name; $_SESSION['town'] = $town; $_SESSION['adress'] = $adress; $_SESSION['tel'] = $tel; $_SESSION['tel_type'] = $tel_type; $_SESSION['mail'] = $mail; }}?><div align="center"><?php if (!isset($_SESSION['user'],$_SESSION['pass'],$_SESSION['name'],$_SESSION['town'],$_SESSION['adress'],$_SESSION['tel'],$_SESSION['mail'])) { echo '<table width="548" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td height="30"><div align="center"> <p><em>Грешно потребителско име или парола.</em></p> </div></td> </tr> <tr> <td><div align="center"><a href="index.php?page=users/login">Назад</a></div></td> </tr> </table> '; } else { echo '<script language=JavaScript>window.location.href="index.php?page=users/wheel"</script>'; exit(); } ?></div>[/code] Quote Link to comment Share on other sites More sharing options...
play_ Posted January 19, 2007 Share Posted January 19, 2007 del1.php[code]<a href="del2.php">This is a link to del2.php</a>[/code]del2.php[code]<?php$previous_page = $_SERVER['HTTP_REFERER'];echo $previous_page;[/code]try those on your computer Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.