PHP Help Needed Immediately
Moderator: General Moderators
PHP Help Needed Immediately
hi guys,
i need some help with thi script that i just wrote in PHP. actually it is my first script but i was pretty confident that it would work well.
but only the register.php and login.php pages are loading.
in everything else there is an error message saying error while parsing on line 3 for all scripts.
the scripts are for a blog. they are located at :
http://www.prithvidesign.com/blogtest/
and all the files are in the zip file in the same folder.
please help me out.
i need some help with thi script that i just wrote in PHP. actually it is my first script but i was pretty confident that it would work well.
but only the register.php and login.php pages are loading.
in everything else there is an error message saying error while parsing on line 3 for all scripts.
the scripts are for a blog. they are located at :
http://www.prithvidesign.com/blogtest/
and all the files are in the zip file in the same folder.
please help me out.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
I only looked at signup.php and login.php, but in signup, you have it should be
Code: Select all
<? phpCode: Select all
<?phperror code
Code: Select all
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/prithvim/public_html/blogtest/signup.php on line 14these are the two scripts that i am using:
and
and this is the error message:
Code: Select all
<html>
<head>
<title>New User Registration</title>
</head>
<body>
<div>
<form action="signup.php" method="post">
<p>
Desired UserID: <input type="text" name="userid" length="8" size="8"><br>
Password: <input type="password" name="password" length="8" size="8"><br>
Full Name: <input type="text" name="name" length="25" size="25"><br>
Email: <input type="text" name="email" length="50" size="50"><br>
</p>
<input type="reset" value="Reset">
<input type="submit" value="Submit">
<p>
<b>Note: All fields are mandatory.</b>
</p>
</form>
</div>
</body>
</html>Code: Select all
<?php
if ( !empty($_POSTї'userid']) && !empty($_POSTї'password']) && !empty($_POSTї'name']) && !empty($_POSTї'email']) )
{
check_userid();
}
else
{
die("<b>Please go back and fill in all the fields.</b>");
}
function check_userid()
{
if(file_exists("$_POSTїuserid].txt"))
{
die("The UserID <b>$_POSTїuserid]</b> already exists.<br/>Please choose another UserID.");
}
else
{
create_file();
}
}
function create_file()
{
touch("$_POSTїuserid].txt");
if($fp=fopen("$_POSTїuserid].txt","w"))
{
create_userid();
}
else
{
die("There was an error processing your request.<br/>Please try again later.");
}
}
function create_userid()
{
if(fwrite($fp,"$_POSTїuserid]\n$_POSTїpassword]\n$_POSTїname]\n$_POSTїemail]\n"))
{
fclose($fp);
die("UserID <b>$_POSTїuserid]</b> successfully created.");
}
else
{
die("There was an error processing your request.<br/>Please try again later.");
}
}
?>Code: Select all
Warning: fwrite(): supplied argument is not a valid stream resource in /home/prithvim/public_html/blogtest/signup.php on line 38
There was an error processing your request.
Please try again later.- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
changein create_file() to then changeto
Code: Select all
create_userid();Code: Select all
create_userid($fp);Code: Select all
function create_userid()Code: Select all
function create_userid($fp)