Jump to content

dominic600

Members
  • Posts

    117
  • Joined

  • Last visited

    Never

Everything posted by dominic600

  1. So im trying to make a sign up forum to where you have to put in your zip code.. and im wanting to make a page to where it shows all the individual zip codes that have register but i dont want mutliples.. for example say i have 5 people register from '90210' and if you go to look at the page where it shows the list of zip codes how could i make it only display '90210' once and not 5 times? im wanting to make this so someone can look at the zip code page and see if anyone near them has registerd on the site as well Thanks
  2. I have my session_start() in my top.php, like i have the same script almost with everything the same for creating a topic and it works perfectly, i just dont know what im missing in this one. As far as showing the errors idk how to do that E_ALL thing or how to turn it on or what ever.. but thanks for all the info and im just wanting to get all my functionality down then im going to work on the secruity, im new to php and mysql so im slowly learning.
  3. so im working on building a forum and i got everything on it but when you go to add a reply to the topic and click the reply button it will just go to a blank screen Not sure why its doing this, never had this problem. heres the code with the button <?php require("top.php"); if ($username && ($_GET['cid'] == "")) { header("Location: home.php"); exit(); } $cid = $_GET['cid']; $tid = $_GET['tid']; ?> <div id='homepageright'> <form action="post_reply_parse.php" method="post"> <p>Reply Comment</p> <textarea name="reply_content" rows="5" cols="75"></textarea> <br /><br /> <input type="hidden" name="cid" value="<?php echo $cid; ?>" /> <input type="hidden" name="tid" value="<?php echo $tid; ?>" /> <input type="submit" name="reply_submit" value="Reply" /> <div id='homepageleft'> </div> </div> </html> </body> and code the button goes to <?php if($username){ header("Location: index.php"); } if(isset($_POST['reply_submit'])){ include_once("scripts/connect.php"); $creator = $_SESSION['uid']; $cid = $_POST['cid']; $tid = $_POST['tid']; $reply_content = $_POST['reply_content']; $sql = "INSERT INTO post (category_id, topic_id, post_creator, post_content, post_date) VALUES ('".$cid."', '".$tid."', '".$creator."', '".$reply_content."', now())"; $res = mysql_query($sql) or die(mysql_error()); $sql2 = "UPDATE categories SET last_post_date=now(). last_user_posted='".$creator."' WHERE id='".$cid."' LIMIT 1"; $res2 = mysql_query($sql2) or die(mysql_error()); $sql3 = "UPDATE topics SET topic_reply_date=now(), topic_last_user'".$creator."' WHERE id='".$tid."' LIMIT 1"; $res3 = mysql_query($sql3) or die(mysql_error()); //email sending if(($res) && ($res2) && ($res3)) { echo "Your Reply Has Been Posted"; } else{ echo "There Was A Problem Posting Your Reply"; } } ?>
  4. so i just tried to get rid of the onClick thing so i changed my line to cho "<tr><td colspan='2'><input type='submit' value='Add Reply' action='http://www.mysite.com/post_reply.php?cid={$cid}&tid={$tid}' /><hr />";
  5. alright, well i did that and its still not working, it seems like on of my quotes is off cause it just dont look right but when i randomly add a quote everything looks good. heres my line now. echo "<tr><td colspan='2'><input type='submit' value='Add Reply' onClick=\"window.location='http://www.trucksterusa.com/post_reply.php?cid={$cid}&tid={$tid}' /><hr />";
  6. oh ok, well i put in the full url but when i click the button it doesnt go to a error or anything, like it wont go to another page at all
  7. heres the line for my button echo "<tr><td colspan='2'><input type='submit' value='Add Reply' onClick=\"window.location = post_reply.php?cid=".$cid."&tid=".$tid."\" /><hr /> "; for some reason when i click on it in the site it does not do anything, but when i type the link in maunaly that the button should link to the page works. heres the code for the page that the button is on <?php require("top.php"); ?> <div id='content'> <div id='homepageright'> <?php require("scripts/connect.php"); if($username){ $cid = intval($_GET['cid']); $tid = intval($_GET['tid']); $sql = "SELECT * FROM topics WHERE category_id = $cid AND id = $tid"; $res = mysql_query($sql) or die(mysql_error()); /*$cid = $_GET['cid']; $tid = $_GET['tid']; $sql = "SELECT * FROM topics WHERE category_id='".$cid."' AND id='".$tid."'"; $res = mysql_query($sql) or die(mysql_error());*/ if(mysql_num_rows($res) == 1){ echo "<table width='100%'>"; if($username){ echo "<tr><td colspan='2'><input type='submit' value='Add Reply' onClick=\"window.location = post_reply.php?cid=".$cid."&tid=".$tid."\" /><hr /> "; } While ($row = mysql_fetch_assoc($res)) { $sql2 = "SELECT * FROM post WHERE category_id='".$cid."' AND topic_id= '".$tid."'"; $res2 = mysql_query($sql2) or die(mysql_error()); while ($row2 = mysql_fetch_assoc($res2)) { echo "<tr><td valign='top' style='border: 1px solid #000000;'><div style='min-height: 125px; '>".$row['topic_title']."<br /> by ".$row2['post_creator']." - ".$row2['post_date']. "<hr /> ".$row2['post_content']."</div></td><td width='200' valign='top' align='center' style='border: 1px solid #000000;'>User Info Here</td></tr><tr><td colspan='2'><hr /></td></tr>"; } echo "</table>"; } } else{ echo "This Topic Does Not Exist."; echo "$sql"; } } else{ echo "You Must Be Logged In To Continue."; } ?> </div> <div id='homepageleft'> <?php ?> </div> </html> </body>
  8. oh ok, i just wish i knew more a about php so i can code on my own and code good, but i got it solved not sure what i did but its working.
  9. where does that code go... sorry im new to this, and im watching/reading a tutorial and this is like this code that it says to do so idk why it has a while loop..
  10. im trying to pay attention the best i can, just im not very fluent in php but thats the problem is the link isnt showing my &tid, im working on getting that to show up and im sure that would fix it possibly this is that my link looks like "view_topic.php?cid=36=6"
  11. i didnt know about that but ill start doing that but when i canged that it still says that but now its SELECT * FROM topics WHERE category_id = 34 AND id = 0 i think the problem is that its not picking up my tid cause no matter which one i click on it stays 0
  12. i echo out the sql and i get SELECT * FROM topics WHERE category_id='36=6' AND id='' LIMIT 1 forsome reason it just dont look right to me, it seems like i have double quotes messed up or something.
  13. well when i am in my forum thing and i go to click on a 'topic' it says no topic exists. and there is one there idk what im missing in the code to make it view it in my table.. <?php require("top.php"); ?> <div id='content'> <div id='homepageright'> <?php include_once("scripts/connect.php"); if($username){ $cid = $_GET['cid']; $tid = $_GET['tid']; $sql = "SELECT * FROM topics WHERE category_id='".$cid."' AND id='".$tid."' LIMIT 1"; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res) == 1){ echo "<table width='100%'>"; if($username){ echo "<tr><td colspan='2'><input type='submit' value='Add Reply' onClick=\"window.location = post_reply.php?cid=".$cid."&tid=".$tid."\" /><hr /> "; } While ($row = mysql_fetch_assoc($res)) { $sql2 = "SELECT * FROM posts WHERE category_id='".$cid."' AND topic_id= '".$tid."'"; $res2 = mysql_query($sql2) or die(mysql_error()); while ($row2 = mysql_fetch_assoc($res2)) { echo "<tr><td valign='top' style='border: 1px solid #000000;'><div style='min-height: 125px; '>".$row['topic_title']."<br /> by ".$row2['post_creator']." - ".$row2['post_date']. "<hr /> ".$row2['post_content']."</div></td><td width='200' valign='top' align='center' style='border: 1px solid #000000;'>User Info Here</td></tr><tr><td colspan='2'><hr /></td></tr>"; } echo "</table>"; } } else{ echo "This Topic Does Not Exist."; } } else{ echo "You Must Be Logged In To Continue."; } ?> </div> <div id='homepageleft'> <?php ?> </div> </html> </body>
  14. i got that fixed now thanks! but can you tell me whats wrong with this line echo "<tr><td colspan='2'><input type='submit' value='Add Reply' onClick=\ "window.location = post_reply.php?cid=".$cid."&tid=".$tid."\" /><hr /> "; cause im getting an error saying expecting a , or ;
  15. i fixed the parentheses and now i get a new error after fixing that other line. new error is unexpected } in line 25
  16. So im using textwrangler and usually when you click on the '{' or '}' it will highlight everything inbetween them, well on the top one on line 7 it does not, and i tried messing around with it to try to get it to work cause i keep getting an error on line 8 that says "Parse error: syntax error, unexpected '{' in /home/truckste/public_html/create_topic_parse.php on line 8" <?php if($username){ header("Location: index.php"); exit(); } if(isset($_POST['topic_submit'])){ if (($_POST['topic_title'] == "" && ($_POST['topic_content'] == "")){ echo "You Did Not Fill In Both Fields. Please Return To The Previous Page."; exit(); } else{ requre('scripts/connect.php'); $cid = $_POST['cid']; $title = $_POST['topic_title']; $content= $_POST['topic_content']; $creator = $_POST['uid']; $sql = "INSERT INTO topics (category_id, topic_title, topic_creator, topic_date, topic_reply_date) VALUES ('".$cid."', '".$title."', '".$creator."', now(), now())"; $res = mysql_query($sql) or die(mysql_error()); $new_topic_id = mysql_insert_id(); $sql2 = "INSERT INTO posts (category_id, topics_id, post_creator, post_content, post_date) VALUES ('".$cid."', '".$new_topic_id."', '".$creator."', '".$content."', now())"; $res2 = mysql_query($sql2) or die(mysql_error()); $sql3 = "UPDATE categories SET last_post_date=now(), last_user_posted'".$creator."', WHERE id='".$cid."' LIMIT 1"; if (($res) && (res2) && (res3)){ header("Location: view_topic.php?cid".$cid."$tid=".$new_topic_id) } else{ echo "There Was A Problem Creating Your Topic. Please Try Again."; } } ?>
  17. okay well i did that and well it gave me an error: Fatal error: Call to undefined function fixtext() in /home/truckste/public_html/index.php on line 61 im not sure why i would get en error on that.
  18. yeah, but idk what to do to do that thing to show the errors.. Cause i just get confused when i look at that link you pointed me too.
  19. but why would i do this? like i know im filling in all the boxes and i know that only certin ones are required but idk why its not picking up on the info i put in .. on either form. could it be becasue i copied and pasted the form from one page to antother?
  20. yes i did, i didnt relize that.. sorry.
  21. Ill mess around with that.. if i can figure out what to do.. But idk why it does it on my register and edit profile..
  22. how would i do that? Just make an if statement for each value?
  23. Ok so for some reasons on my register and edit profile page when i hit submit it says that i have not filled in all the info i need.. Even after i fill all of them in.. but heres the code for the register form.. <?php require("top.php"); ?> <div id='homeright'> <?php echo "<font size='6'>Sign up</font>"; echo "<hr width='75%' align='left'/>"; $form = "<form action='index.php' method='post'> <table cellspacing='5px'> <tr> <td>First Name:</td> <td class='register'><input type='text' name='firstname' class='textbox' size='35'></td> </tr> <tr> <td>Last Name:</td> <td><input type='text' name='lastname' class='textbox' size='35'></td> </tr> <tr> <td>Username:</td> <td><input type='text' name='username' class='textbox' size='35'></td> </tr> <tr> <td>E-mail:</td> <td><input type='text' name='email' class='textbox' size='35'></td> </tr> <tr> <td>Password:</td> <td><input type='password' name='password' class='textbox' size='35'></td> </tr> <tr> <td>Confirm Password:</td> <td><input type='password' name='repassword' class='textbox' size='35'></td> </tr> <tr> <td></td> <td><input type='submit' name='submitbtn' value='Register' class='button'></td> </tr> </table> </form>"; if ($_POST['submitbtn']){ $firstname = fixtext($_POST['firstname']); $lastname = fixtext($_POST['lastname']); $username = fixtext($_POST['username']); $email = fixtext($_POST['email']); $password = fixtext($_POST['password']); $repassword = fixtext($_POST['repassword']); $website = fixtext($_POST['website']); $youtube = fixtext($_POST['youtube']); $bio = fixtext($_POST['bio']); $name = $_FILES['avatar'] ['name']; $type = $_FILES['avatar'] ['type']; $size = $_FILES['avatar'] ['size']; $tmpname = $_FILES['avatar']['tmpname']; $ext = substr($name, strrpos($name, '.')); if ($firstname && $lastname && $username && $email && $password && $repassword){ if ($password == $repassword){ if (strstr($email, "@") && strstr($email, ".") && strlen($email) >= 6){ require("scripts/connect.php"); /*$query = mysql_query("SELECT * FROM users WHERE username='$username' ");*/ $query=mysql_query("SELECT * FROM users WHERE username='$username' ") or die(mysql_error()); $numrows = mysql_num_rows($query); if ($numrows == 0){ /*$query=mysql_query("SELECT * FROM users WHERE email='$email' ");*/ $query=mysql_query("SELECT * FROM users WHERE email='$email' ") or die(mysql_error()); $numrows=mysql_num_rows($query); if ($numrows == 0){ $pass = md5(md5($password)); $date = date("F d, Y"); if($name){ move_uploaded_file($tmpname, "avatars/$username.$ext"); $avatar = "$username.$ext"; } else $avatar = "/avatars/default_avatar.png"; $code = substr (md5(rand(11111111111, 999999999999999)), 2, 25); mysql_query("INSERT INTO users (`first_name`,`last_name`,`username`,`email`,`password`,`avatar`,`bio`,`website`,`youtube`,`last_login`,`active`,`code`,`locked`,`date`) VALUES ( '$firstname', '$lastname', '$username', '$email', '$pass', '$avatar', '$bio', '$website', '$youtube', '', '0', '$code', '0', '$date')"); /*mysql_query("INSERT INTO users (Field, Type) VALUES ('', '$firstname', '$lastname', '$username', '$email', 'pass', '$avatar', '$bio', '$website', '$youtube', '', '0', '$code', '0', '$date')");*/ $webmaster = "Admin@trucksite.com"; $subject = "Activate Your Account!"; $headers = "From: Admin <$webmaster>"; $message = "Hello $firstname.\n\nWelcome to trucksite below is a link for you to activate your account!.\n http://tprofiletesting.net23.net/activate.php?code=$code"; mail($email, $subject, $message, $headers); echo "Your activation email has been sent to <b>$email</b>."; } else echo "That email is currently in use."; } else echo "That username is currently in use."; } else echo "You did not enter a vaild email."; } else echo "Your passwords did not match."; } else echo"You did not fill in all the required fields."; } echo "$form"; ?> </div> <div id='homeleft'> <center><font size='6'>Create! Showoff! Educate!</font></center> <hr /> </div> </body> </html>
  24. How would I go about making it so users can upload there own photos and have other people view them on there own personal profile? I just cant seem to find a tutorial that helps me on what im trying to do. Thanks, Dominic
  25. dominic600

    phpBB

    My question is, is it possible to create a phpbb forum via cpannel in my hosting service, that would be able to use the same loggin as the user registerd for for the website. Like i dont want someone to have to register for the website and have to register to use the forum.. Or do i just have to code my own forum? Thanks, Dominic
×
×
  • 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.