View Full Version : PHP: lots of questions
Bouley86
02-12-2003, 06:54 PM
Ok, I dunno what happened. Remember how I had all those questions about the PHP guestbook script before? Well i got everything running and now all of a sudden NOTHING will work. I have a whole bunch of other scripts besides the guestbook one and they just wont work anymore. I thought maybe the problem is the permissions when the files are first created but i dunno what is going on and Im gettin really frustrated. so here's some of the things im having trouble with.
if (isset($sn) & isset($pass)) {
if (ereg("^[A-Za-z0-9]+$","$sn")) {
if (is_dir("$userpath/$sn")) {
echo "<head><title>Bouley86.com Profiles: New User</title></head><body><center><font face='Arial'><p>Name already in use.</p></center>";
} elseif (strlen($sn) < 4) {
echo "<head><title>Bouley86.com Profiles: New User</title></head><body><center><font face='Arial'><p>Name too short. Must be 4+ characters.</p></center>";
} elseif (strlen($pass) < 4) {
echo "<head><title>Bouley86.com Profiles: New User</title></head><body><center><font face='Arial'><p>Password too weak. Must be 4+ characters.</p></center>";
} else {
$dir = "$userpath/$sn";
mkdir("$dir" , 0777);
$pfile = fopen("$dir/pass.php","w");
fputs($pfile,"<? \$mypass = \"$pass\"; ?>");
fclose($pfile);
echo "<head><style type='text/css'>
With the above, i have it set so it will make the directory and set the permissions to 777, but it doesnt set them to that, it sets them to 755. And I think because this folder isnt being set to 777 is why my guestbook file isnt writing correctly. So can anyone help with this?
transmothra
02-12-2003, 09:54 PM
i'd contact tech support for the host and ask them. could be their PHP is busted...
or they could CHmod it for you if it's a permissions problem. (i have the same problem... why won't these &$%@*^ FTP clients do what you tell 'em to??)
tonto
02-12-2003, 11:53 PM
try this but i am not sure if it will work..
mkdir("$dir");
`chmod 0777 $dir` ;
tonto
scoutt
02-13-2003, 12:40 AM
how do you know it is set to 755?
ok, add this to your mkdir
$oldmask = umask(0);
mkdir ($path, 0777);
umask($oldmask);
Bouley86
02-17-2003, 10:50 AM
ok, now how do i get it to chmod a file to 777? I have the following so that it makes a blank file called gbook.txt:
$gfile = fopen("$dir/gbook.txt","w+");
fclose($gfile);
What do I add to chmod that to 777?
scoutt
02-17-2003, 12:40 PM
$gfile = fopen("$dir/gbook.txt","w+");
fclose($gfile);
chmod ("$dir/gbook.txt", 0777);
Bouley86
02-17-2003, 06:22 PM
alrite, now that that problem is solved (thank you!!) how would i make it so that when a person signs up by going to the new.php file, it will send them an email and in the email is a link that sends them to a page to confirm their registration and makes the directory and files. Somewhat complicated so if it doesn't make sense, here's another explanation. Ok, so let's say you want the username test and the password test. You signup on a page called new.php. Then you're told to check your email and there's a message that links to a page called profile.php. So the link is something like profile.php?mode=confirm&sn=test&pass=test and when you go to that page it creates your account. If you don't go to the page, the account doesn't get created. Understand? so how would I do that, and what files do you need me to post so you can help? Thanks so much for all of your help!
scoutt
02-17-2003, 07:15 PM
it all depends on what mail you are sending. you can send the link but it is not a good idea to send the password in the url, make it so they use cookies or sessions. once they click on the link that tells them they have email then you add them to a holding table in the db. then when they click on the link in the email it will pull that info form that table then update the process so the account gets created. understand??
Bouley86
02-17-2003, 07:22 PM
Alrite, I got it so that does what I origonally wanted, but lemme see if I understand what you're sayin. By using the cookies or database or whatever would there be a way so that the person only has a certain number of days before the info is deleted. Like lets say they send the form, then they have 5 days to go to the link in their email and confirm it. If they go within the 5 days the account gets created, but if they go after 5 days they have to resubmit the form. How would I do that?
scoutt
02-17-2003, 07:58 PM
you will have to put a time in the table as will. then have in your cript that will detect that date and see if it has been 5 days and if it has then delete it. if not then leave it there.
Bouley86
02-17-2003, 08:12 PM
ok....so how do i put that into my scripts? and do you need me to post the php so that you know what to do or no?
scoutt
02-18-2003, 12:28 AM
I am not going to write it for you. but I will guide you.
look into time() as that will be entered into the db. then all you have to do it grab it and compare it to now whic again is the time() as it is when they get to the page. 1 hour is 3600 seconds. time() goes by seconds. so you have 3600 * 24 will be 1 day and X that by 5 days.
so you have this
time entered into the db.
dbtime = 500000
today = 700000
fivedays = 432000
if today - fivedays <= dbtime then let them add the account.
understand? if not look at the manual for time() and you will.
Bouley86
02-18-2003, 12:25 PM
Ok I understand what you're saying and I understand how to use the time() to get it..but I can't get anything I'm trying to work... The main thing I'm having a problem with is the if this - that <= theotherthing ...
scoutt
02-18-2003, 01:14 PM
ok show me what you got.
Bouley86
02-18-2003, 01:21 PM
in my new.php file (this is the one users register in)
$time = time();
$dbfile = fopen("$path/db/$sn.php","w");
fputs($dbfile,"<? \$sn = \"$sn\"; \$pass = \"$pass\" \$then = \"time\"?>\n");
fclose($dbfile);
mail("$email" , "Bouley86.com Profile Registration" , "This email is to confirm your registration at Bouley86.com Profiles.
If you did not sign up for this service or you no longer wish to have the account created, ignore this email.
If you want your account to be made click the link below. Your information will be set up as follows - \r\nUsername: $sn\r\nPassword: $pass\r\n
If this is not the information you want to be set up go back to http://profiles.bouley86.com and send the form again.\r\n
http://profiles.bouley86.com/profile.php?mode=confirm&sn=$sn&pass=$pass\r\n\r\n
Thank you for choosing Bouley86.com Profiles!");
And then in my profile.php file (this is the whole file because i don't know where i need to add the if now-then <= blah blah blah..)
<?
include("settings.php");
if (isset($mode)) {
if ($mode == "login") {
if ((isset($sn)) && (isset($pass))) {
if (($sn != "") && ($pass != "")) {
$dir = "$userpath/$sn";
include("$dir/pass.php");
if ($pass == $mypass) {
// SHOW THE SCREEN
include("mods.php");
} else {
echo "<head><style type='text/css'>
<!--
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: underline}
A:hover {text-decoration: underline}
-->
</style>
<style type='text/css'>
A:link {color: #000000;}
A:visited {color: #000000;}
A:hover {color: #000000;}
</style><title>Bouley86.com Profiles: Login</title></head><body><center><font face='Arial'><p>Incorrect login.</p></center>";
}
} else {
echo "<head><style type='text/css'>
<!--
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: underline}
A:hover {text-decoration: underline}
-->
</style>
<style type='text/css'>
A:link {color: #000000;}
A:visited {color: #000000;}
A:hover {color: #000000;}
</style><title>Bouley86.com Profiles: Login</title></head><body><center><font face='Arial'><p>Incorrect login.</p></center>";
}
} else {
echo "<head><style type='text/css'>
<!--
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: underline}
A:hover {text-decoration: underline}
-->
</style>
<style type='text/css'>
A:link {color: #000000;}
A:visited {color: #000000;}
A:hover {color: #000000;}
</style><title>Bouley86.com Profiles: Login</title></head><body><center><font face='Arial'><p>Username and/or password not entered.</p></center>";
}
} elseif ($mode = "update") {
echo "<font face='Arial'><center><b><p>Update mode.</p></b>";
$dir = "$userpath/$sn";
$cnf = fopen("$dir/config.php","w+");
$maintext = stripslashes(htmlspecialchars($maintext));
$spcontent1 = stripslashes(htmlspecialchars($spcontent1));
$spcontent2 = stripslashes(htmlspecialchars($spcontent2));
$spcontent3 = stripslashes(htmlspecialchars($spcontent3));
$spcontent4 = stripslashes(htmlspecialchars($spcontent4));
$spcontent5 = stripslashes(htmlspecialchars($spcontent5));
$sptitle1 = stripslashes(htmlspecialchars($sptitle1));
$sptitle2 = stripslashes(htmlspecialchars($sptitle2));
$sptitle3 = stripslashes(htmlspecialchars($sptitle3));
$sptitle4 = stripslashes(htmlspecialchars($sptitle4));
$sptitle5 = stripslashes(htmlspecialchars($sptitle5));
fputs($cnf,"<? ");
fputs($cnf,"\$sn=\"$sn\"; ");
fputs($cnf,"\$ip=\"$REMOTE_ADDR\"; ");
fputs($cnf,"\$font=\"$font\"; \$colortext=\"$colortext\"; ");
fputs($cnf,"\$colorback=\"$colorback\"; \$colorlink=\"$colorlink\"; ");
fputs($cnf,"\$coloralink=\"$coloralink\"; \$colorvlink=\"$colorvlink\"; ");
fputs($cnf,"\$maintext=\"$maintext\"; ");
fputs($cnf,"\$sptitle1=\"$sptitle1\"; \$spcontent1=\"$spcontent1\"; ");
fputs($cnf,"\$sptitle2=\"$sptitle2\"; \$spcontent2=\"$spcontent2\"; ");
fputs($cnf,"\$sptitle3=\"$sptitle3\"; \$spcontent3=\"$spcontent3\"; ");
fputs($cnf,"\$sptitle4=\"$sptitle4\"; \$spcontent4=\"$spcontent4\"; ");
fputs($cnf,"\$sptitle5=\"$sptitle5\"; \$spcontent5=\"$spcontent5\"; ");
fputs($cnf,"\$linktitle1=\"$linktitle1\"; \$linkurl1=\"$linkurl1\"; ");
fputs($cnf,"\$linktitle2=\"$linktitle2\"; \$linkurl2=\"$linkurl2\"; ");
fputs($cnf,"\$linktitle3=\"$linktitle3\"; \$linkurl3=\"$linkurl3\"; ");
fputs($cnf,"\$linktitle4=\"$linktitle4\"; \$linkurl4=\"$linkurl4\"; ");
fputs($cnf,"\$linktitle5=\"$linktitle5\"; \$linkurl5=\"$linkurl5\"; ");
fputs($cnf,"\$linktitle6=\"$linktitle6\"; \$linkurl6=\"$linkurl6\"; ");
fputs($cnf,"\$linktitle7=\"$linktitle7\"; \$linkurl7=\"$linkurl7\"; ");
fputs($cnf,"\$linktitle8=\"$linktitle8\"; \$linkurl8=\"$linkurl8\"; ");
fputs($cnf,"\$friendname1=\"$friendname1\"; ");
fputs($cnf,"\$friendname2=\"$friendname2\"; ");
fputs($cnf,"\$friendname3=\"$friendname3\"; ");
fputs($cnf,"\$friendname4=\"$friendname4\"; ");
fputs($cnf,"\$friendname5=\"$friendname5\"; ");
fputs($cnf,"\$email=\"$email\"; ");
fputs($cnf," ?>");
fclose($cnf);
echo "<center><font face='Arial'>Configuration updated for $sn.</center>";
if ($clearlist != "") {
unlink("$dir/last.txt");
echo "<center><font face='Arial'><p>Last view list cleared.</center>";
}
?>
<head>
<style type='text/css'>
<!--
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: underline}
A:hover {text-decoration: underline}
-->
</style>
<style type='text/css'>
A:link {color: #000000;}
A:visited {color: #000000;}
A:hover {color: #000000;}
</style>
<title>Bouley86.com Profiles: Login</title>
</head>
<body>
<center>
<font face='Arial'>To add a link to your profile,<br>
paste the following code into your profile.<br><br>
<textarea cols=50 rows=6><HTML>Check out my <A HREF="<? echo $serviceurl; ?>/view.php?sn=<? echo $sn; ?>&rn=%n&a=b" TARGET="_self">Bouley86.com Profile</A>.</textarea>
<form action="profile.php?mode=login" method="post">
<input type="hidden" name="sn" value="<? echo $sn; ?>">
<input type="hidden" name="pass" value="<? echo $pass; ?>">
<input type="submit" value="Back To Config">
</form></center>
<?
} else {
echo "<head><style type='text/css'>
<!--
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: underline}
A:hover {text-decoration: underline}
-->
</style>
<style type='text/css'>
A:link {color: #000000;}
A:visited {color: #000000;}
A:hover {color: #000000;}
</style><title>Bouley86.com Profiles: Login</title></head><body><p><center><font face='Arial'>Incorrect usage.</p>";
}
} else {
echo "<head><style type='text/css'>
<!--
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: underline}
A:hover {text-decoration: underline}
-->
</style>
<style type='text/css'>
A:link {color: #000000;}
A:visited {color: #000000;}
A:hover {color: #000000;}
</style><title>Bouley86.com Profiles: Login</title></head><body><p><center><font face='Arial'><b>Logging In.</b></p>";
?>
<center>
<form action="profile.php?mode=login" method="post">
<table>
<tr>
<td><font face='Arial'>Name: </td>
<td><input type=text name=sn></td>
</tr>
<tr>
<td><font face='Arial'>Password: </td>
<td><input type=password name=pass></td>
</tr>
</table>
<p><input type="submit" value="Login"></p>
</form>
<p><font face='Arial'>If you don't have an account, <a href="new.php">signup</a> for one.</p>
<p>
<?
}
?>
Thank you for your help!
scoutt
02-18-2003, 01:49 PM
wow, it i s awhole lot easier if you wer using mysql, but anyway.
I would put it down by the form where they login. you have to opne the file that holds the time for that user and grap it and compare it to 5 days time.
<?
if((today - fivedays) <= dbtime){
?>
<form action="profile.php?mode=login" method="post">
<table>
<tr>
<td><font face='Arial'>Name: </td>
<td><input type=text name=sn></td>
</tr>
<tr>
<td><font face='Arial'>Password: </td>
<td><input type=password name=pass></td>
</tr>
</table>
<p><input type="submit" value="Login"></p>
</form>
<?
} else {
echo "you are too late, start over";
exit;
}
Bouley86
02-18-2003, 05:29 PM
how would i do it using mysql cuz i have it on my server (im pretty new to a lot of stuff..i just got hooked on php..so much easier than PERL..) I would have to have a table set up and all that stuff rite? How do I do that..
Thanks so much for all your help!
scoutt
02-18-2003, 07:45 PM
if you want to use mysql then donwload or see if your host has phpMyAdmin available. if not then you can download it at http://www.phpwizard.net/projects/phpMyAdmin/
nd then look into the php manual and/or the mysql manual. pretty easy
Bouley86
02-20-2003, 11:12 PM
alrite, here's what im looking at now:
$maintext = stripslashes(htmlspecialchars($maintext));
$spcontent1 = stripslashes(htmlspecialchars($spcontent1));
$spcontent2 = stripslashes(htmlspecialchars($spcontent2));
$spcontent3 = stripslashes(htmlspecialchars($spcontent3));
$spcontent4 = stripslashes(htmlspecialchars($spcontent4));
$spcontent5 = stripslashes(htmlspecialchars($spcontent5));
$sptitle1 = stripslashes(htmlspecialchars($sptitle1));
$sptitle2 = stripslashes(htmlspecialchars($sptitle2));
$sptitle3 = stripslashes(htmlspecialchars($sptitle3));
$sptitle4 = stripslashes(htmlspecialchars($sptitle4));
$sptitle5 = stripslashes(htmlspecialchars($sptitle5));
And that removes the html characters right? Well let's say that on one of the pages I wanna allow HTML, because I do, but I want to not have to add / before every set of quotes. if there somthing similar that i can use to stripslashes that will add a back slash before each quote?
And as a side note, my server does have phpMyAdmin so im workin rite now on tryin to use it...
scoutt
02-21-2003, 01:24 AM
to add slashes you just use addslashes() :rolleyes: :P
Bouley86
02-21-2003, 11:24 AM
Ok now here's the problem Im having with that. How do i get it to only add slashes before double quotes and not single quotes?
scoutt
02-21-2003, 11:56 AM
you don't. if you want just that (which is not recommended) then you have to do a str_replace
str_replace("\"","\\"", $string);
I recommend you read the manual as all this is in there. it can be found at www.php.net
I just have to say that by letting users add html and quotes it not a good idea unless you check for possibleities of bad code. somebody can send a query in the text box and delete all your tables or anyhting else they wanted. it is always best to chck for these things and escape all quotes single or double.
Bouley86
02-21-2003, 12:05 PM
this isnt for my users..its for the same script but im using it for myself in a different way so i'm making sure to check everything that i do to it...not to worry..
Bouley86
02-21-2003, 12:34 PM
ok i tried adding that..but now when i go to profile.php (the page that it's on) nothing comes up..just a blank page
scoutt
02-21-2003, 12:53 PM
lets see the profile page.
Bouley86
02-21-2003, 06:21 PM
<?
$userpath = "/home/sites/www.bouley86.com/web/profiles";
$serviceurl = "http://profiles.bouley86.com/SPARTiCUS14";
if (isset($mode)) {
if ($mode == "login") {
if ((isset($sn)) && (isset($pass))) {
if (($sn != "") && ($pass != "")) {
$dir = "$userpath/$sn";
include("$dir/pass.php");
if ($pass == $mypass) {
// SHOW THE SCREEN
include("mods.php");
} else {
echo "<head><style type='text/css'>
<!--
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: underline}
A:hover {text-decoration: underline}
-->
</style>
<style type='text/css'>
A:link {color: #000000;}
A:visited {color: #000000;}
A:hover {color: #000000;}
</style><title>Bouley86.com Profiles: Login</title></head><body><center><font face='Arial'><p>Incorrect login.</p></center>";
}
} else {
echo "<head><style type='text/css'>
<!--
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: underline}
A:hover {text-decoration: underline}
-->
</style>
<style type='text/css'>
A:link {color: #000000;}
A:visited {color: #000000;}
A:hover {color: #000000;}
</style><title>Bouley86.com Profiles: Login</title></head><body><center><font face='Arial'><p>Incorrect login.</p></center>";
}
} else {
echo "<head><style type='text/css'>
<!--
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: underline}
A:hover {text-decoration: underline}
-->
</style>
<style type='text/css'>
A:link {color: #000000;}
A:visited {color: #000000;}
A:hover {color: #000000;}
</style><title>Bouley86.com Profiles: Login</title></head><body><center><font face='Arial'><p>Username and/or password not entered.</p></center>";
}
} elseif ($mode = "update") {
echo "<font face='Arial'><center><b><p>Update mode.</p></b>";
$dir = "$userpath/$sn";
$cnf = fopen("$dir/config.php","w+");
$maintext = str_replace(\",\\", $maintext);
$spcontent1 = str_replace(\",\\", $spcontent1);
$spcontent2 = str_replace(\",\\", $spcontent2);
$spcontent3 = str_replace(\",\\", $spcontent3);
$spcontent4 = str_replace(\",\\", $spcontent4);
$spcontent5 = str_replace(\",\\", $spcontent5);
$spcontent6 = str_replace(\",\\", $spcontent6);
$spcontent7 = str_replace(\",\\", $spcontent7);
$spcontent8 = str_replace(\",\\", $spcontent8);
$spcontent9 = str_replace(\",\\", $spcontent9);
$spcontent10 = str_replace(\",\\", $spcontent10);
$spcontent11 = str_replace(\",\\", $spcontent11);
$spcontent12 = str_replace(\",\\", $spcontent12);
$spcontent13 = str_replace(\",\\", $spcontent13);
$spcontent14 = str_replace(\",\\", $spcontent14);
$spcontent15 = str_replace(\",\\", $spcontent15);
$spcontent16 = str_replace(\",\\", $spcontent16);
$spcontent17 = str_replace(\",\\", $spcontent17);
$spcontent18 = str_replace(\",\\", $spcontent18);
$spcontent19 = str_replace(\",\\", $spcontent19);
$spcontent20 = str_replace(\",\\", $spcontent20);
$sptitle1 = stripslashes(htmlspecialchars($sptitle1));
$sptitle2 = stripslashes(htmlspecialchars($sptitle2));
$sptitle3 = stripslashes(htmlspecialchars($sptitle3));
$sptitle4 = stripslashes(htmlspecialchars($sptitle4));
$sptitle5 = stripslashes(htmlspecialchars($sptitle5));
$sptitle6 = stripslashes(htmlspecialchars($sptitle6));
$sptitle7 = stripslashes(htmlspecialchars($sptitle7));
$sptitle8 = stripslashes(htmlspecialchars($sptitle8));
$sptitle9 = stripslashes(htmlspecialchars($sptitle9));
$sptitle10 = stripslashes(htmlspecialchars($sptitle10));
$sptitle11 = stripslashes(htmlspecialchars($sptitle11));
$sptitle12 = stripslashes(htmlspecialchars($sptitle12));
$sptitle13 = stripslashes(htmlspecialchars($sptitle13));
$sptitle14 = stripslashes(htmlspecialchars($sptitle14));
$sptitle15 = stripslashes(htmlspecialchars($sptitle15));
$sptitle16 = stripslashes(htmlspecialchars($sptitle16));
$sptitle17 = stripslashes(htmlspecialchars($sptitle17));
$sptitle18 = stripslashes(htmlspecialchars($sptitle18));
$sptitle19 = stripslashes(htmlspecialchars($sptitle19));
$sptitle20 = stripslashes(htmlspecialchars($sptitle20));
fputs($cnf,"<? ");
fputs($cnf,"\$sn=\"$sn\"; ");
fputs($cnf,"\$ip=\"$REMOTE_ADDR\"; ");
fputs($cnf,"\$font=\"$font\"; \$colortext=\"$colortext\"; ");
fputs($cnf,"\$colorback=\"$colorback\"; \$colorlink=\"$colorlink\"; ");
fputs($cnf,"\$coloralink=\"$coloralink\"; \$colorvlink=\"$colorvlink\"; ");
fputs($cnf,"\$maintext=\"$maintext\"; ");
fputs($cnf,"\$sptitle1=\"$sptitle1\"; \$spcontent1=\"$spcontent1\"; ");
fputs($cnf,"\$sptitle2=\"$sptitle2\"; \$spcontent2=\"$spcontent2\"; ");
fputs($cnf,"\$sptitle3=\"$sptitle3\"; \$spcontent3=\"$spcontent3\"; ");
fputs($cnf,"\$sptitle4=\"$sptitle4\"; \$spcontent4=\"$spcontent4\"; ");
fputs($cnf,"\$sptitle5=\"$sptitle5\"; \$spcontent5=\"$spcontent5\"; ");
fputs($cnf,"\$sptitle6=\"$sptitle6\"; \$spcontent6=\"$spcontent6\"; ");
fputs($cnf,"\$sptitle7=\"$sptitle7\"; \$spcontent7=\"$spcontent7\"; ");
fputs($cnf,"\$sptitle8=\"$sptitle8\"; \$spcontent8=\"$spcontent8\"; ");
fputs($cnf,"\$sptitle9=\"$sptitle9\"; \$spcontent9=\"$spcontent9\"; ");
fputs($cnf,"\$sptitle10=\"$sptitle10\"; \$spcontent10=\"$spcontent10\"; ");
fputs($cnf,"\$sptitle11=\"$sptitle11\"; \$spcontent11=\"$spcontent11\"; ");
fputs($cnf,"\$sptitle12=\"$sptitle12\"; \$spcontent12=\"$spcontent12\"; ");
fputs($cnf,"\$sptitle13=\"$sptitle13\"; \$spcontent13=\"$spcontent13\"; ");
fputs($cnf,"\$sptitle14=\"$sptitle14\"; \$spcontent14=\"$spcontent14\"; ");
fputs($cnf,"\$sptitle15=\"$sptitle15\"; \$spcontent15=\"$spcontent15\"; ");
fputs($cnf,"\$sptitle16=\"$sptitle16\"; \$spcontent16=\"$spcontent16\"; ");
fputs($cnf,"\$sptitle17=\"$sptitle17\"; \$spcontent17=\"$spcontent17\"; ");
fputs($cnf,"\$sptitle18=\"$sptitle18\"; \$spcontent18=\"$spcontent18\"; ");
fputs($cnf,"\$sptitle19=\"$sptitle19\"; \$spcontent19=\"$spcontent19\"; ");
fputs($cnf,"\$sptitle20=\"$sptitle20\"; \$spcontent20=\"$spcontent20\"; ");
fputs($cnf,"\$email=\"$email\"; ");
fputs($cnf," ?>");
fclose($cnf);
echo "<center><font face='Arial'>Configuration updated for $sn.</center>";
if ($clearlist != "") {
unlink("$dir/last.txt");
echo "<center><font face='Arial'><p>Last view list cleared.</center>";
}
?>
<head>
<style type='text/css'>
<!--
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: underline}
A:hover {text-decoration: underline}
-->
</style>
<style type='text/css'>
A:link {color: #000000;}
A:visited {color: #000000;}
A:hover {color: #000000;}
</style>
<title>Bouley86.com Profiles: Login</title>
</head>
<body>
<center>
<font face='Arial'>To add a link to your profile,<br>
paste the following code into your profile.<br><br>
<textarea cols=50 rows=6><HTML>Check out my <A HREF="<? echo $serviceurl; ?>/view.php?sn=<? echo $sn; ?>&rn=%n&a=b" TARGET="_self">Bouley86.com Profile</A>.</textarea>
<form action="profile.php?mode=login" method="post">
<input type="hidden" name="sn" value="<? echo $sn; ?>">
<input type="hidden" name="pass" value="<? echo $pass; ?>">
<input type="submit" value="Back To Config">
</form></center>
<?
} else {
echo "<head><style type='text/css'>
<!--
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: underline}
A:hover {text-decoration: underline}
-->
</style>
<style type='text/css'>
A:link {color: #000000;}
A:visited {color: #000000;}
A:hover {color: #000000;}
</style><title>Bouley86.com Profiles: Login</title></head><body><p><center><font face='Arial'>Incorrect usage.</p>";
}
} else {
echo "<head><style type='text/css'>
<!--
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: underline}
A:hover {text-decoration: underline}
-->
</style>
<style type='text/css'>
A:link {color: #000000;}
A:visited {color: #000000;}
A:hover {color: #000000;}
</style><title>Bouley86.com Profiles: Login</title></head><body><p><center><font face='Arial'><b>Logging In.</b></p>";
?>
<center>
<form action="profile.php?mode=login" method="post">
<table>
<tr>
<td><font face='Arial'>Name: </td>
<td><input type=text name=sn></td>
</tr>
<tr>
<td><font face='Arial'>Password: </td>
<td><input type=password name=pass></td>
</tr>
</table>
<p><input type="submit" value="Login"></p>
</form>
<p><font face='Arial'>If you don't have an account, <a href="new.php">signup</a> for one.</p>
<p>
<?
}
?>
Bouley86
02-21-2003, 06:25 PM
don't worry about it too much..im gonna work on it tonite cuz i just noticed a whole bunch of problems..
scoutt
02-21-2003, 09:25 PM
ugg what is all that? where is "$spcontent1" coming from?
and all the rest of those variables? no need for those..
Bouley86
02-22-2003, 02:11 PM
ok..i know i probably seem like a huge pain in the you know what by asking all these questions but I can't find any documentation that is helpful. I can't figure out how to even get started with MySQL or phpMyAdmin. Is there somewhere I can go that will give full accurate details on how to use this. Like for example with the registering of users that I was talking about previously with email confirmation and all that jazz. What do I do? Where do I go? Thanks for your help.
scoutt
02-22-2003, 06:32 PM
wha tdo you mean register users? the mysql db is a db and it doesn't just do one thing, you have to tell it to insert or update or select. look at www.mysql.com and download the manual. it will explian a lot of things. also phpmyadmin is easy. you insert the username, passowrd, and dabasename and that is it. you enter all tha tin the config file and upload it to your server and then run index.php. how hard is that? then you can see wha tthe teabels you have and the fields.
my site has loads of tutorials on mysql, also Jollyfactory's site has a bunch as well. one of them are bound to tell you what you want.
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.