I hope someone can help. I am a bit of a newbie to php.
I am running two programs on my site. Both require logins. I have placed login panels to both on my homepage.
The only problem is that both scripts need variables called username and password.
This causes a validation error as you can imagine.
I know that one method would be to change one of the programs variable names, but this will violate my licences.
I cant think of it, but is there a way I could write a simple php page that collects variable for one of them using new names such as username2 and password2, rename them to username and password but retain the results, and then automatically post them to the second program script using the correct variable names?
I hope someone can help with this.
Regards
Cosarin
Variable Titles Problem
Moderator: General Moderators
Variable Titles Problem
Last edited by Cosarin on Sun Aug 13, 2006 2:46 pm, edited 1 time in total.
Volka.
No there are not invoked at the same time.
I can simply leave them both called the same titles, and everything works fine.
The problem is that two fields with the same title name cause validation errors.
The validation errors do not stop anything working, but I like to keep things neat so that my pages validate correctly.
Hope you can help
Cosarin
No there are not invoked at the same time.
I can simply leave them both called the same titles, and everything works fine.
The problem is that two fields with the same title name cause validation errors.
The validation errors do not stop anything working, but I like to keep things neat so that my pages validate correctly.
Hope you can help
Cosarin
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Can you modify the PHP code from either of the two scripts that are using the login forms? If so, go into one and change all references to $_POST['username'] and $_POST['password'] to $_POST['newusernamefield'] and $_POST['newpasswordfield']. That should correct it in the code. Then just change the username and password field names in the form for that login process to newusernamefield and newpasswordfield (or whatever you choose for them, but you get the point).
I still do not see the problem ...because I'm not sure what the scenario really is.
Two scripts that react on same user input. They do not run at the same time. Validation errors.
Ok, makes me guess that maybe, just maybe there are two form elements on the same page having the same field/names ..?..
If so, there is no problem with validation
If so, why do they need different credentials to authenticate the same user?
Two scripts that react on same user input. They do not run at the same time. Validation errors.
Ok, makes me guess that maybe, just maybe there are two form elements on the same page having the same field/names ..?..
If so, there is no problem with validation
Code: Select all
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>xyz</title>
</head>
<body>
<form method="post" action="whatever1">
<div>
<input type="text" name="username" />
<input type="text" name="password" />
<input type="submit" />
</div>
</form>
<form method="post" action="whatever2">
<div>
<input type="text" name="username" />
<input type="text" name="password" />
<input type="submit" />
</div>
</form>
</body>
</html>Or is it not about the html code but the two scripts trying to authenticate the user from the same http request data?http://validator.w3.org/check wrote:This Page Is Valid XHTML 1.0 Strict!
If so, why do they need different credentials to authenticate the same user?