Hi I have uploaded a script,done all thing right,site runs great but when i go to login in to admin i keep getting this coming up in the browser.. /admin/index.php?error=wu so i have gone to php myadmin and checked the user name and password there and i'm using the rights one's, but still i can't access the admin panel,heres the admin/index.php part on the above error, <script language="JavaScript"> <?php if(isset($error)) { if($error=="wu")print("alert('Invalid Username and password!');"); if($error=="lo")print("alert('Your session has expired!');"); } ?> </script> if you can help me i would be most greatful
We need to see the script or part of the script that redirects to this index.php page. The code you pasted doesn't help. Also please use php or code tags. It might look like this: header("Location: /admin/index.php?error=wu") PHP:
} else { header("Location: index.php?error=wu"); exit; } ?> Hi sorry don't know what php or code tags is or are
We still need to see the rest of the code and just put " " and "[php]" around the code you paste. You need to show us all code that you think is relevant to solve this problem. The code you have shown us now can tell us nothing at all in terms of what the problem can be! Also put error_reporting on as this may reveal something. Put this at the top of all your scripts or change your php.ini: [php]error_reporting(E_ALL | E_STRICT); PHP:
<? include '../conf/config.php'; include '../conf/opendb.php'; $username=trim($username); $password=trim($lpassword); $sql="select password from admin_autooptout where username='$username'"; $result=mysql_query($sql); while($row=mysql_fetch_array($result)) { $dbpass=$row[0]; } if($dbpass==$password) { session_start(); $admin_username=$username; session_register("admin_username"); } else { header("Location: index.php?error=wu"); exit; } ?>[php] PHP:
Have you created the database? Did you provide the correct database username/password? Btw, do you know the script you are installing and what it does?
Hi Thanks for the info,yes used the right database user/pw yes the script is a store its only small 180 files,so you think it should be ok,i will greate another db and run the install again, thanks for your help
It looks like a script you bought or is pre-made and it should require minimal changes. I don't changing anything in the php.ini fille will help. But do put error_reporting (that line of code I have you) on those two scripts you showed me. Also do you have access to your error_log?
Hi I put the error_reporting on top like you said i am now receiving this error_reporting(E_ALL | E_STRICT); Warning: Cannot modify header information - headers already sent by (output started at /home/sell/public_html/admin/login.php:2) in /home/sell/public_html/admin/login.php on line 29 When i try and login in the adminpanel: And this is the line 29 in admin login.php header("Location: index.php?error=wu");
Can you use full php tags: <? //not this <?php //use this PHP: Also make sure there is no white space before this tag. Also what version of PHP are you using?
The above will just solve that warning but not the actual problem. When you said you checked db for username/password - is the password in the clear, I mean plain text and you can see it? What about that error_log, anything?
Yes double checked the db user/pw in clear txt and every thing is as it should be, any other ideas,and thanks for your help
Ok, can you do this: print_r($row); $dbpass=$row[0]; PHP: Put this above that line and remove or comment out the header redirection. Paste the output you get here, you can hide some details if you want such as username/password.
That error means that you have already output data to the browser before you used the header() or session_start() functions. Before that, is anything being echoed to the screen or is any HTML output to the screen?
This is true. But it would fix the problem he stated in his previous post. And that problem must be corrected before any others can be taken care of.
Hi I have got it to work in the end,i just want to thank you very much for helping me,all i done was php_flag register_globals on in the .htaccess and all is well, regards