Jump to content

dominic600

Members
  • Posts

    117
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dominic600's Achievements

Member

Member (2/5)

0

Reputation

  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
×
×
  • 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.