Hi. got Easy Php 1.8, for my certificate iv web admin course at my local college in australia. and when i try to run my html form, and the script, in a separate file, it just shows the php code in the browser. and now put the script in the www folder of Easy php and have to do a local host which is http://localhost/UserDetails.php. do i need the html form and the script in this www. dolferfolder. and how do i set it up, so i do not have to do this all the time. driving me crazy, as a blind web developer, using a screen reader. so if any one has had the same problem, using easy php 1.8 for windows 2000 pro, let me know. either post on the forum or e-mail me privately. cheers Marvin.
Php Help Needed
Have you started Apache ?
Hi. yes tried looking on google, but could not seem to find any thing. found some sites, but not what i am looking for, that is why i asked on this forum. cheers Marvin.
Sorry your screen reader picked up my signature rather than my post. I actual question was have you made sure that Apache is running ?
Hi.
yes got apache, installed, with Easy Php 1.8, but it says the server is not running. did have iis, but disabled the service, in the admin settings in control panel.
will it work if i put my html form, and my php in the one file, or will it work, as i have the file pointed in my form. doing an assignment, and when i do the http://localhost/UserDetails.php, it reverts to all lower case, and says parce error on line 2.
that is the two problems, how to run my thml with php, and how to fix this problem, for this assignment, and tried looking, but still stuck, and frustrated.
cheers Marvin.
There are two ways to handle a form which submits to php.
You can have the form html and the php inside the same file, which must be named with a .php extension, and make it submit to itself.
The easier way when you are starting, is to put the form in one html file and the php code in a seperate file. Point the form to the php file. They both must be in the same folder.
A parse error usually means that there is a missing semi-colon, bracket or some other piece of punctuation. These are the most common errors in php and the easiest to track down and fix. Post the first few lines of your code here and I will have a look if you like.
Hi.
tried to u-upload the two files, but did not like the file types.
so will paste the code for the html and the php files.
cheers Marvin.
<html>
<head>
<title>User Login Form</title>
</head>
<body>
<script>
(documents(0).forms(0).fields(1).setFocus)
</script>
<form action="UserDetails.php" method="post">
<p>User Name: <input type="text" name="UserName"> </p>
<p>Password: <input type="text" name="Password" </p>
<p><input type="submit" value="Login"> </p>
</form>
</body>
</html><?php
<?php echo $POST['username']; ?>.
<?php echo $POST['password']; ?>
echo "Marvin Hunkin has successfully logged into the Tafe network.";
echo "Please Wait ... Loading Your Personal Settings ...";
echo "time();"
?>
khendar wrote:Have you started Apache ?
Ok your problem is in UserDetails.php. You have an opening php tag - then another opening php tag immediately after it. This is causing the parse error. You need to remove the opening and closing tags around the echo POST statements and just have the single enclosing php tags.
You also have an extra period after the echo post username statement.
And the echo "time();" statement does not need the double quotes around it.
Hopefully this helps.
Hi.
now did what you suggested.
and made the edited changes.
now had to load easy php, 1.8, and then go to http://locahlhost/UserDetails. http://localhost/UserDetails.php
and got the following error.
will paste the error and the new updated code.
and now do i need to put the user form html file in the same directory as the user details php file in the www folder in easy php?
if so, let me know.
cheers Marvin.
Notice: Undefined index: username in c:\program files\easyphp1-8\www\userdetails.php on line 2
echo $_POST['password']; ?> echo "Marvin Hunkin has successfully logged into the Tafe network."; echo "Please Wait ... Loading Your Personal Settings ...";
echo time(); ?>
<?php
echo $POST['username']; ?>
echo $POST['password']; ?>
echo "Marvin Hunkin has successfully logged into the Tafe network.";
echo "Please Wait ... Loading Your Personal Settings ..."
<?php
echo $POST['username']; ?>
echo $POST['password']; ?>
echo "Marvin Hunkin has successfully logged into the Tafe network.";
echo "Please Wait ... Loading Your Personal Settings ...";
echo time();
?>;
echo time();
?>
It looks like you have have too many closing php tags. After echo $POST['username']; and echo $POST['password']; you need to remove these ?> tags.
I think the undefined index problem is caused by the case of your variable names. In your form the variables are named UserName and Password with capital letters. Whereas when you get them from POST in your php they are all lowercase. Change the field names in your form to lowercase and it should work fine.
Hi.
tried your suggestions.
took out the > character.
and changed the username and password variables in the html to lower case.
and now still getting the error.
copied the html and the new php to the www folder in easy php.
now why is this happening?
can you please take a look.
will paste the error message, the html code and the new php file.
cheers Marvin.
Notice: Undefined index: username in c:\program files\easyphp1-8\www\userdetails.php on line 2
Notice: Undefined index: password in c:\program files\easyphp1-8\www\userdetails.php on line 3
Marvin Hunkin has successfully logged into the Tafe network.Please Wait ... Loading Your Personal Settings ...1144293889
<html>
<head>
<title>User Login Form</title>
</head>
<body>
<script>
(documents(0).forms(0).fields(1).setFocus)
</script>
<form action="UserDetails.php" method="post">
<p>User Name: <input type="text" name="username"> </p>
<p>Password: <input type="text" name="password" </p>
<p><input type="submit" value="Login"> </p>
</form>
</body>
</html><?php
echo $POST['username'];
echo $POST['password'];
echo "Marvin Hunkin has successfully logged into the Tafe network.";
echo "Please Wait ... Loading Your Personal Settings ...";
echo time();
?>
khendar wrote:Have you started Apache ?
Hi.
dumped my html form, and php script, and used the localhost.
now did want the username edit field to go first, did that the first time, but now, is still jumping to the login button.
put in the javascript.
to do that to set focus to the first form field.
now got my script working.
went to http://localhost/UserDetails.html.
tabbed to the password user name field.
now it does the job.
it shows me the username and password, no space, but it shows the message all on one line, and shows me the user name and password.
and shows me the time all in one long string.
will paste the output below.
so got it working, now only need help with do the following:
- hide my username and password, and how do i do this in either html or php?
- how do i format it so the text say the message is on two line, with the first line on one line, with a line break.
then the second message on the next line with a line break, and then how to . - how to format the time to say the time is or just shows 1:50 pm.
if you can help me out with that, then got it basically working.
thanks for all your help.
so if you can help me out with this final step.
then let me know.
cheers Marvin.
usernamepasswordMarvin Hunkin has successfully logged into the Tafe network.Please Wait ... Loading Your Personal Settings ...1144294882and