Jump to content

dominic600

Members
  • Posts

    117
  • Joined

  • Last visited

    Never

Everything posted by dominic600

  1. yeah so i got it fixed, turns out when i created a user i didnt set permessions and did not save it.. lol but thanks for all the help!
  2. heres the errors im getting.. and plus my ip for my server did not work. Strict Standards: mysql_connect() [function.mysql-connect]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/truckste/public_html/scripts/connect.php on line 8 Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on '97.92.195.84' (4) in /home/truckste/public_html/scripts/connect.php on line 8 Strict Standards: mysql_select_db() [function.mysql-select-db]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/truckste/public_html/scripts/connect.php on line 9 Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'truckste'@'localhost' (using password: NO) in /home/truckste/public_html/scripts/connect.php on line 9 Strict Standards: mysql_select_db() [function.mysql-select-db]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/truckste/public_html/scripts/connect.php on line 9 Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/truckste/public_html/scripts/connect.php on line 9 Strict Standards: mysql_query() [function.mysql-query]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/truckste/public_html/login.php on line 35 Warning: mysql_query() [function.mysql-query]: Access denied for user 'truckste'@'localhost' (using password: NO) in /home/truckste/public_html/login.php on line 35 Strict Standards: mysql_query() [function.mysql-query]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/truckste/public_html/login.php on line 35 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/truckste/public_html/login.php on line 35 Access denied for user 'truckste'@'localhost' (using password: NO)
  3. okay so i used my ip and it worked i guess.. now im getting errors on time setting and its saying my pasword is wrong so im going to try another password
  4. yeah I know. but the problem is i cant find it or anywhere cause where it says "server: Localhost via UNIX socket" and in the 000webhost it had a url for the server.
  5. it does not show anythign different.but i think what my problem is, in my connect.php is for teh server name i have localhost.. so i have to find the server ip or name for it so maybe it would work.
  6. i changed all the host details cause at first i was getting errors saying i didnt have permession and all that stuff so when i got everything how it should be in my connect.php then the errors go away and i get that database error
  7. oh ok i looked at it and changed all the info from my old server to my new one. but when i import the .sql files is there something the old host could have inserted into them that could be messing this up?
  8. so im transfering all my stuff from one hosting provider to my paid host. and well when i got to login it says 'no database selected' and idk why cause that is not in my login.php.. url for site is www.trucksterusa.com login.php code: <?php require("top.php"); ?> <div id='content'> <hr /> <?php $form = "<form action='login.php' method='post'> <center><table> <tr> <td>Username:</td> <td><input type='text' name='username' class='textbox'></td> </tr> <tr> <td>Password:</td> <td><input type='password' name='password' class='textbox'></td> </tr> <tr> <td></td> <td><input type ='submit' name='loginbtn' value='Login' class='button'></td> </tr> </table></center> </form> <hr /> If you are not registed, you can do so<a href='register.php'>HERE</a>"; if ($_POST['loginbtn']){ $username = strip_tags($_POST['username']); $password = strip_tags($_POST['password']); if($username && $password){ require("scripts/connect.php"); $pass = md5(md5($password)); $query = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$pass'") or die(mysql_error()); $numrows = mysql_num_rows($query); if ($numrows == 1){ $row = mysql_fetch_assoc($query); $dbid = $row['id']; $dbuser = $row['username']; $active = $row['active']; if($active == 1){ $date = ("F d, Y"); mysql_query("UPDATE users SET last_login='$date' WHERE id='$dbid'"); $_SESSION['username'] = $dbuser; $_SESSION['userid'] = $dbid; echo "<body onLoad=\"setTimeout('redirect();', 1500);\">"; echo "You are now loged in.<a href='http://tprofiletesting.net23.net'> Click here </a>to return Home."; } else echo "You must activate your account to login."; } else echo "Your Username and/or Password are not valid. <br /><br />If you do not have an account, you can register for one <a href='register.php'>here</a>."; } else echo "You did not fill in the correct fields."; } else echo "$form"; ?> <hr /> </div> <div id='footer'></div> </body> </html>
  9. that was not working, so i just decided to get my paid hosting from another service and it works, now i just cant get it to connect to the database but link is www.trucksterusa.com
  10. yeah i know. thats the default 404 error. idk why its doing that.
  11. so my website is not showing up after i tried to do a 'simple machines forum' forum and then it messed it all so so i deleted everything on the server and re ftpd everything and now well it goes to an error page and was working perfet 10 mins ago. Idk what could be wrong with it. but heres the link to the site. trucktesting2.comyr.com sorry if this is the wrong section, i dont know where it would go honestly.
  12. UPDATE I got it connecting to the database. And now its saying i do not have all the required feilds filled in. even when i fill in them all!
  13. Oh ok. well what other info or code do you need to see?
  14. sorry for the delay in replying my internet went out. but my $username is defined in my top.php
  15. So im creating an 'edit profile' page and when i go to test it, it will not connect to the database. I know its not th database cause it still allows me to login, post comments and stuff like that. Heres the code its probably something obivious that im just over looking but im not sure.. <?php require("top.php"); ?> <div id='content'> <?php if($username){ require('scripts/connect.php'); if ($_POST['savebtn']){ $firstname = fixtext($_POST['firstname']); $lastname = fixtext($_POST['lastname']); $email = fixtext($_POST['email']); $website = fixtext($_POST['website']); $youtube = fixtext($_POST['youtube']); $bio = fixtext($_POST['bio']); $password = fixtext($_POST['password']); $name = $_FILES['avatar'] ['name']; $type = $_FILES['avatar'] ['type']; $size = $_FILES['avatar'] ['size']; $tmpname = $_FILES['avatar']['tmpname']; $ext = substr($name, strrpos($name, '.')); if ($firstname && $lastname && $email && $password){ if (strstr($email, "@") && strstr($email, ".") && strlen($email) >= 6){ $password = md5($password); $query = mysql_query("SELECT password FROM users WHERE id='$userid'"); $numrows = mysql_num_rows($query); if($numrows == 1){ mysql_query ("UPDATE users SET firstname='$first_name' WHERE id='$userid'"); mysql_query ("UPDATE users SET lastname='$last_name' WHERE id='$userid'"); mysql_query ("UPDATE users SET email='$email' WHERE id='$userid'"); mysql_query ("UPDATE users SET website='$website' WHERE id='$userid'"); mysql_query ("UPDATE users SET youtube='$youtube' WHERE id='$userid'"); mysql_query ("UPDATE users SET bio='$bio' WHERE id='$userid'"); if ($name){ $avatarname = $username.$ext; move_upload_file($tmpname, "avatars/$avatarname"); mysql_query ("UPDATE INTO users SET avatar='$avatarname' WHERE id='$userid'"); } echo "Changes have been saved."; } else echo "Your password was incorrect."; } else echo "You did not enter a valid Email."; } else echo "You did not provide the required info."; } $query = mysql_query("SELECT * FROM users WHERE id='$getid'"); $numrows = mysql_num_rows($query); if($numrows == 1){ $row = mysql_fetch_assoc($query); $id = $row['id']; $firstname = $row['firstname']; $lastname = $row['lastname']; $email = $row['email']; $avatar = $row['avatar']; $bio =($row['bio']); $website = $row['website']; $youtube = $row['youtube']; $lastlogin = $row['last_login']; $active = $row['active']; $locked = $row['locked']; $date = $row['date']; } else echo "An error occured while connecting to the datatbase."; $infoform = "<form action='editprofile.php' method='post'> <table cellspacing='10px'> <tr> <td>First Name:</td> <td><input type='text' name='firstname' class='textbox' size='40' value='$firstname'><font color='red'>*</font></td> </tr> <tr> <td>Last Name:</td> <td><input type='text' name='lastname' class='textbox' size='40' value='$lastname'><font color='red'>*</font></td> </tr> <tr> <td>E-mail:</td> <td><input type='text' name='email' class='textbox' size='40' value='$email'><font color='red'>*</font></td> </tr> <tr> <td>Avatar:</td> <td><input type='file' name='avatar'></td> </tr> <tr> <td>Website:</td> <td><input type='text' name='website' class='textbox' size='40' value='$website'></td> </tr> <tr> <td>Youtube User Name:</td> <td><input type='text' name='youtube' class='textbox' size='40' value='$youtube'></td> </tr> <tr> <td>Bio:</td> <td><textarea name='bio' cols='35' rows='5' class='textbox'>$bio</textarea></td> </tr> <tr> <td>Current Password:</td> <td><input type='password' name='password' class='textbox' size='40'><font color='red'>*</font></td> </tr> <tr> <td></td> <td><input type='submit' name='savebtn' value='Confirm Changes' class='button'></td> </tr> </table> </form>"; echo "$infoform"; ///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// echo "<br /><hr /><br />"; $passform ="<form action='editprofile.php' method='post'> <table cellspacing='10px'> <tr> <td>Current Password:</td> <td><input type='password' name='oldpass' class='textbox' size='40'><font color='red'>*</font></td> </tr> <tr> <td>New Password:</td> <td><input type='password' name='newpass' class='textbox' size='40'><font color='red'>*</font></td> </tr> <tr> <td>Confirm New Password:</td> <td><input type='password' name='confirmpass' class='textbox' size='40'><font color='red'>*</font></td> </tr> <tr> <td></td> <td><input type='submit' name='updatepass' class='submitbtn' size='40'><font color='red'>*</font></td> </tr> </table></form>"; if($_POST['passbtn']){ $oldpass = fixtext($_POST['oldpass']); $newpass = fixtext($_POST['newpass']); $confirmpass = fixtext($_POST['confirmpass']); if($oldpass && $newpass && $confirmpass){ if ($newpass == $confirmpass){ $oldpass = md5($oldpass); $newpass = md5($newpass); $query = mysql_query("SELECT password FROM users WHERE id='$userid'"); $numrows = mysql_num_rows($query); if($numrows == 1){ mysql_query ("UPDATE users SET password='$newpass' WHERE id='$userid'"); echo"Your password has been changed."; } else echo "Your current password is incorrect."; } else echo "Your new passwords did not match."; } else echo"You did not fill in all required fileds."; } else echo "$passwform"; } else echo "you must be logged in to do that."; ?> </div> <div id='footer'></div> </body> </html>
  16. why would i pay you when there are others that would be awesome and shoot me ideas for free.... @jaysonic & quickoldcar thanks for the ideas! ill put some thought into them!
  17. So, i am working on this website and i need to comeup with a name for it now. the website is where you have a the ability to upload pictures of your truck or car, write something about it and then post on other peoples profiles about what you think and i want people to be able to help other people with problems and stuff like that. im open to any name sugestions, just perfer them to be short and catchy. Thanks, Dominic
  18. thank you, but sorry if this is a dumb question but where it says !isset what do i put there or does it just stay isset
  19. so ive been trying to figure this out on my own with as little help possible. but now im stuck. so i got my commenting system all down and good but now i want to make it so inorder for anyone to comment they must login. theres my sessions, now would i make like a if statement like if($username && $userid){ $query = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$pass'") or die(mysql_error()); $numrows = mysql_num_rows($query); } $username = $_SESSION['username']; $userid = $_SESSION['userid']; Like would that work or am i missing something else, or would that be like completly wrong?
  20. yes, like i have this. $_SESSION['username'] = $dbuser; $_SESSION['userid'] = $dbid;
  21. yeah, but they all have different values. so like i had to go in and changed the css values for each one to get them all to match up lol
  22. okay so i got all this, just by looking at my other php files and i figured this is what it should look like to require the loggin to access it. But it does not work. Do you see what im missing or doing wrong? <?php require("top.php"); ?> <div id='comments'> <?php $getid = $_GET['id']; if(!$getid) $getid = "1"; require("scripts/connect.php"); $query = mysql_query("SELECT * FROM users WHERE id='$getid'"); $numrows = mysql_num_rows($query); if($numrows == 1){ require ("scripts/comment_connect.php"); $getdata = mysql_query ("SELECT * FROM comments ORDER BY date AND time ASC"); while($row = mysql_fetch_assoc($getdata)){ $id = $row['id']; $name = $row['name']; $message = $row['message']; $date = $row['date']; $time = $row['time']; $message = nl2br($message); echo" <table> <tr> <td><b>$name on $date at $time</b></td> </tr> <tr> <td>$message</td> </tr> </table> <br /> <hr />"; } $button = $_POST['button']; if($button){ $name = $_POST['name']; $message = $_POST['message']; if ($name && $message){ $dayofweek = date("l"); $month = date("F"); $dayofmonth = date("d"); $year = date("Y"); $date = "$dayofweek $month $dayofmonth, $year"; $hours = date("g"); $min = date("i"); $sec = date("s"); $amorpm = date("a"); $timezone = date("T"); $time = "$hours:$min:$sec $amorpm $timezone"; require ("scripts/comment_connect.php"); $queryget = mysql_query("SELECT * FROM comments WHERE name='$name' AND message='$message'"); $numrows = mysql_num_rows($queryget); if($numrows != 1){ $query = mysql_query("INSERT INTO comments VALUES ('', '$name', '$message', '$date', '$time')"); echo "Your message has been sent!"; } else echo "You can NOT resubmit the same message!"; } else echo "You did not fill in all fields."; } echo " <form action='comments.php' method='POST'> <table width='400'> <tr> <td width='100'>Name:</td> <td><input type='text' name='name'></td> </tr> <tr> <td width='100'>Message:</td> <td><textarea name='message' cols='50' rows='3'></textarea></td> </tr> <tr> <td width='100'></td> <td><input type='submit' name='button' value='Submit'</td> </tr> </table></form> "; } else echo "This needs to be changed"; ?> </div> </body> </html>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.