Cetanu
Members-
Posts
395 -
Joined
-
Last visited
Never
Everything posted by Cetanu
-
I fixed it. Now it goes down to 650px x 800px
-
Okay, I'll try this, then.
-
I checked my Spam folders, but it wasn't there. :-\ I am using a free webhost, maybe that's the problem, if that's the case, that is bad. But I checked something a while back that said emails were allowed...maybe I was looking at the wrong thing. I'll try and contact the host, and I'll try to change the header. Thanks, guys.
-
I did that. No luck. The emails never even showed up in my Yahoo or my GMail. EDIT: The change in the PHP echoed "Mail Sent", which is good, let's see if I can get it. EDIT #2: I didn't get it, this time I tried Yahoo, GMail, and my School Email Address. No luck.
-
That'll mess it up more, though, because right now it can grow to, I think, 1600 x 1200, and shrink to about 800... I'm deathly terrified of screwing with the CSS since I just got it to be more or less fluid.
-
Anyone have any clues maybe as to why?
-
I don't receive emails in my account. I tried to email addresses and neither received the test emails I sent.
-
Yep, I could do that, but I would need to manually update a link every time a new user joins, right? I guess I could use that while I am a small site. Here's the registration script: <?php //Create registration form (register.php) include "db_connect.php"; if(!$_POST['submit']) { } else { $first = protect($_POST['first']); $username = protect($_POST['username']); $password = protect($_POST['password']); $pass_conf = protect($_POST['pass_conf']); $email = protect($_POST['email']); $about = protect($_POST['about']); $errors = array(); $regex = "/^[a-z0-9]+([_\.-][a-z0-9]+)*@([a-z0-9]+([.-][a-z0-9]+)*)+\.[a-z]{2,}$/i"; if(!preg_match($regex, $email)) { $errors[] = "E-mail is not in name@domain format!"; } if(!$first || !$username || !$password || !$pass_conf || !$email || !$about) { $errors[] = "You did not fill out the required fields"; } $sql = "SELECT * FROM `users` WHERE `username`='{$username}'"; $query = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($query) > 0) { $errors[] = "Username already taken, please try another"; } if(count($errors) > 0) { echo "The following errors occured with your registration"; echo "<font color=\"red\">"; foreach($errors AS $error) { echo "<p>" . $error . "\n"; } echo "</font>"; echo "<a href=\"javascript:history.go(-1)\">Try again</a>"; //we use javascript to go back rather than reloading the page // so the user doesn't have to type in all that info again. } else { $sql = "INSERT into `users`(`first`,`username`,`password`,`email`,`about`) VALUES ('$first','$username','".md5($password)."','$email','$about');"; $query = mysql_query($sql) or die(mysql_error()); echo "Thank You for registering {$first_name}! Your username is {$username}"; echo "<a href=\"index.php\"> Click here </a> to Login"; } } ?>
-
Um...what? I don't understand what ya' said.
-
I am using a login/registration script that gives people a profile, but I cannot figure how to add links to the profiles automatically. This is how I get a link for a user to go to THEIR OWN profile: echo "<a href=\"profile.php?username=".$_SESSION['username']."\">View Profile</a>"; But what do I do if I want a link to be generated for each user, maybe next to their username on the memberlist? Or is that impossible-- do I need to manually make a link for every user?
-
Okay, thanks.
-
If I wanted to create a new column in a table using MySQL, how would I do this? I looked into CREATE, but I only found out how to create new tables, not add columns to existing tables. How could I do this? Thanks.
-
Hey, guys. The mail() function will not work for me and I was wondering if anyone could tell me why... contact.php <?php session_start(); ?> <!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> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Contact Us</title> <link rel="stylesheet" type="text/css" href="/style.css" /> <link rel="shortcut icon" href="/fav.png"> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style-ie.css" /> <![endif]--> <script type="text/javascript"> function cacherVoir(theDIV){ leStyle = document.getElementById(theDIV).style ; if(leStyle.display == "block") { leStyle.display = "none"; } else{ leStyle.display = "block"; } } </script> <meta name="verify-v1" content="LiYZqvPLQLMOR/3+Stk2cMxWr2l80SisI86GjbuNmLU=" > <style type="text/css"> #header{ margin:0 auto; } #container{ background: #4b4214 url() repeat-y scroll 0 0; overflow:hidden; margin:0 auto; width:82%; } #left-sidebar{ margin-left:0; padding-left:50px; width:150px; float:left; padding-top:20px; } #main-content{ width:62%; margin-left:0; padding-left:80px; float:left; padding-right:0; } #footer{margin:0 auto;} </style> </head> <body> <div id="page-wrap"> <div id="inside"> <div id="header"> <?php include "button.php"; ?> </div> <div style="clear:both;"></div> <div id="container"> <div id="left-sidebar"> <p> <?php include "home.php"; ?><br/> <a href="http://mythscape.freezoka.com/wiki//index.php?MythScapeMainPage" target="_blank">Wiki</a></div> </p> <div id="main-content"> <a href="index.php">Home</a><br/> <form method="post" action="sendeail.php"> <fieldset> <legend>Contact Form</legend> <!-- DO NOT change ANY of the php sections --> <?php $ipi = getenv("REMOTE_ADDR"); $httprefi = getenv ("HTTP_REFERER"); $httpagenti = getenv ("HTTP_USER_AGENT"); ?> <input type="hidden" name="ip" value="<?php echo $ipi ?>" /> <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" /> <input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" /> Your Name: <br /> <input type="text" name="visitor" size="35" /> <br /> Your Email:<br /> <input type="text" name="visitormail" size="35" /> <br /> <br /> <br /> Subject:<br /> <select name="attn" size="1"> <option value=" Help ">Help </option> <option value=" Comments ">Comments </option> <option value=" Feedback ">Feedback </option> <option value=" Suggestions ">Suggestions </option> <option value=" General Question ">General Question </option> <option value=" Unspecified ">Other </option> </select> <br /><br /> Content <br /> <textarea name="notes" rows="4" cols="40"></textarea> <br /> <input type="submit" value="Submit" /> </fieldset></form> <br /> </div> </div> <div style="clear: both;"></div> <?php include "footer.php"; ?></p> </div></div> <div style="clear: both;"></div> </div> </body> </html> sendeail.php <?php session_start(); ?> <!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> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Send Email</title> <link rel="stylesheet" type="text/css" href="style.css" /> <link rel="shortcut icon" href="fav.png"> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style-ie.css" /> <![endif]--> <script type="text/javascript"> function cacherVoir(theDIV){ leStyle = document.getElementById(theDIV).style ; if(leStyle.display == "block") { leStyle.display = "none"; } else{ leStyle.display = "block"; } } </script> <meta name="verify-v1" content="LiYZqvPLQLMOR/3+Stk2cMxWr2l80SisI86GjbuNmLU=" > <style type="text/css"> #header{ margin:0 auto; } #container{ background: #4b4214 url() repeat-y scroll 0 0; overflow:hidden; margin:0 auto; width:82%; } #left-sidebar{ margin-left:0; padding-left:50px; width:150px; float:left; padding-top:20px; } #main-content{ width:62%; margin-left:0; padding-left:80px; float:left; padding-right:0; } #footer{margin:0 auto;} </style> </head> <body> <div id="page-wrap"> <div id="inside"> <div id="header"> <?php include "button.php"; ?> </div> <div style="clear:both;"></div> <div id="container"> <div id="left-sidebar"> <p><?php include "home.php"; ?><br/> <a href="http://mythscape.freezoka.com/wiki//index.php?MythScapeMainPage" target="_blank">Wiki</a></div> </p> <div id="main-content"><?php $ip = $_POST['ip']; $httpref = $_POST['httpref']; $httpagent = $_POST['httpagent']; $visitor = $_POST['visitor']; $visitormail = $_POST['visitormail']; $notes = $_POST['notes']; $attn = $_POST['attn']; if (eregi('http:', $notes)) { die ("Do NOT try that! ! "); } if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,"."))) { echo "<h2><a href='contact.php'>Enter valid e-mail</a></h2>\n"; $badinput = "<h2>Query was NOT submitted</h2>\n"; echo $badinput; die (""); } if(empty($visitor) || empty($visitormail) || empty($notes )) { echo "<h2><a href='contact.php'>Fill in all fields!</a></h2>\n"; die (""); } $todayis = date("l, F j, Y, g:i a") ; $attn = $attn ; $subject = $attn; $notes = stripcslashes($notes); $message = " $todayis [EST] \n Attention: $attn \n Message: $notes \n From: $visitor ($visitormail)\n Additional Info : IP = $ip \n Browser Info: $httpagent \n Referral : $httpref \n "; $from = "From: $visitormail\r\n"; mail("predhead9@yahoo.com", $subject, $message, $from); ?> <p align="center"> Date: <?php echo $todayis ?> <br /> Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> ) <br /> Subject: <?php echo $attn ?> <br /> Message:<br /> <?php $notesout = str_replace("\r", "<br/>", $notes); echo $notesout; ?> <br /> <?php echo $ip ?> <br /><br /> <a href="contact.php"> Send Another </a> | <a href="index.php">Home</a> </p> </div> </div> <div style="clear: both;"></div> <div id="footer"> <p><?php include "footer.php"; ?></p> </div></div> <div style="clear: both;"></div> </div> </body> </html> Thanks
-
What resolution is your monitor? It works like a charm in IE , however once the site goes down to 800 x 600 it does that and I cannot stop this, but it's a minor problem. Very minor compared to what used to happen.
-
The following code is for a profile-editing page and there is something wrong with it. I have no idea where, but there is something wrong. I've searched high and low. I bet it's small and easy to find, but can someone help? <?php session_start(); include "db_connect.php"; ?> <!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> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title><?php echo $_SESSION['username']; ?>'s Profile</title> <link rel="stylesheet" type="text/css" href="style.css" /> <link rel="shortcut icon" href="fav.png"> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style-ie.css" /> <![endif]--> </head> <body> <div id="page-wrap"> <div id="inside"> <div id="header"> <img src="button.png" alt="mythscape"/> <br/> MythScape -v. 1.5-! </div> <div style="clear:both;"></div> <div id="left-sidebar"><?php include "home.php"; ?> </div> <div id="main-content"> <?php if($_SESSION['id']) { echo "<a href=\"home.php\">Home</a><br/>"; echo "<a href=\"logout.php\">Logout</a><br/>"; $sql="SELECT * from `users` WHERE `id`='".$_SESSION['id']."'"; $res=mysql_query($sql); $row=mysql_fetch_assoc($res); //-----------------------PRINT FORM----------------------- if(!$_POST['update']) { <form method="post" action="profilecp.php"> <br/><strong>Profile Control Panel</strong><br/><br/> <label for="first">First Name</label> <input id="first" type="text" name="first" maxlength="32" value="<?php echo $row['first']; ?>"> <label for="email">Email</label> <input id="email" type="text" name="email" maxlength="255" value="<?php echo $row['email']; ?>"> <label for="about">About</label> <textarea id="about" cols="40" rows="6" name="about"><?php echo $row['about']; ?></textarea> <input type="submit" name="update" value="Update"> </form> //-----------------------UPDATE DATABASE------------------------- } else { $first_name=protect($_POST['first']); $about=protect($_POST['about']); $email=protect($_POST['email']); $sql3 = "UPDATE `users` SET `first`='$first_name',`email`='$email',`about`='$about' WHERE `id`='".$_SESSION['id']."'"; $res3 = mysql_query($sql3) or die(mysql_error()); echo "Your profile has been successfully updated!"; } } else { echo "<script language=\"Javascript\" type=\"text/javascript\">document.location.href='index.php'</script>"; } ?> </div> <div style="clear: both;"></div> <div id="footer"> <p><div id="footer"><a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/us/"><img class="center" alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-nd/3.0/us/88x31.png" /></a><br /></div></p> </div></div> <div style="clear: both;"></div> </div> <?php include "analytics.php"; ?> </body> </html>
-
I just installed a whole bunch of new logins and profile scripts, and the stupid things all used JavaScript for error messages. Now I need to change them all. By the way, I got rid of that javascript menu just for you guys.
-
Okay thanks! That is an amazing tut with some awesome $_SESSION help!
-
Right now on my site I am using setcookie(loggedin), but I was told that I should use sessions because cookies can be exploited. I was wondering if that was true and, if so, how I would make a session that starts when someone logs in on the log-in form on the home page, and then carry that session over to every page. Thanks in advance, Cetanu
-
Okay. Thanks a lot to everyone who helped me accomplish this. It's fixed.
-
I downloaded a backup of my MySQL database, but dunno what to do now...I would like to use the backup to restore the database to its original state. Thanks.
-
Wait, the database field is set to be too short to be hashed? Okay, I can change it. YES I am happy that I backed it up. I'll go do that, thanks I'll pro'ly have one or two more questions.
-
Okay, I found that a variable was improperly defined and then retried it so this is the final after my change: QUERY: select password from users where username = 'Admin' POSTED VALUES: - Username: Admin - Password: ------ [<< I changed it to that, it showed my password] - Hashed Password: 89cda54482caa1e9b5544b204b0ad06a7d57df4e Database Password: 89cda54482caa1e9b5544b204b0ad06a
-
Okay: QUERY: select password from users where username = 'Admin' POSTED VALUES: - Username: Admin - Password: ------ - Hashed Password: 89cda54482caa109b5544b204b0ad06a7d57df4e Database Password:
-
Well I sort of have an idea what the code's doing, but this is really a learn-as-you-go experience for me. That's what PHP has been so far, and I think I've learned a fair bit. I'll see what happens when I echo $match. Thanks. EDIT: It does echo what I want it to! With this: <?php include("config.php"); // connect to the mysql server $link = mysql_connect($server, $db_user, $db_pass) or die ("Could not connect to mysql because ".mysql_error()); // select the database mysql_select_db($database) or die ("Could not select database because ".mysql_error()); include ("function.php"); $match = "select id from $table where username = '".$_POST['username']."' and password = '".hashPW($_POST['password'],$_POST['username'])."';"; echo $match; ?> So it would have to be something in here: ... $qry = mysql_query($match) or die ("Could not match data because ".mysql_error()); $num_rows = mysql_num_rows($qry); if ($num_rows <= 0) { echo "Sorry, there is no username, {$_POST['username']}, with the specified password.<br/>"; echo "<a href=user_login.php>Try again</a>"; exit; } else { setcookie("loggedin", "TRUE", time()+(3600 * 24)); setcookie("mysite_username", "{$_POST['username']}"); header('Location:http://mythscape.freezoka.com/'); die(); } ?> Right?