Jump to content

Cetanu

Members
  • Posts

    395
  • Joined

  • Last visited

    Never

Everything posted by Cetanu

  1. Changed it. No luck. Could it be that there is no switch?
  2. No switch. I didn't know I need it. But this is what it looks like: <?php include "db.php"; session_start(); $id=$_GET['id']; mysql_query("DELETE FROM messages WHERE `ID`='$id' AND `to`='{$_SESSION['username']}'"); header('Location: http://mythscape.freezoka.com/pmindex.php'); ?>
  3. Hehe, it works, but guess what: the messages don't get deleted! XD
  4. I'll look into that. Thanks.
  5. I don't think switching hosts would be good, since I've already advertised the Freezoka site all over. What does the switch do?!! It looks so strange. Not solved yet; I still need to test the code after I unblock the site...somehow...
  6. LtfOL, no session_start(); wasn't in there before. And I'll change to_userid and from_userid when I get a chance. Sadly, I cannot test the new code because my ISP blocked my website or something. I need to talk with them about it...
  7. $_SESSION['username'] DB structure? Well there's ID, to_userid, from_userid, subject, and content. What if I added in session_start(); ?
  8. I changed it to this: <?php include "db.php"; switch($_GET['go']){ case 'delete'; delete(); break; } function delete(){ $id=$_GET['id']; mysql_query("DELETE FROM messages WHERE `ID`='$id' AND `to_userid`='{$_SESSION['username']}'"); header('Location: http://mythscape.freezoka.com/pmindex.php'); } ?> And still now luck!
  9. Nope not solved. It doesn't work. <?php switch($_GET['go']){ case 'delete': delete(); break; } function delete(){ $id=$_GET['id']; mysql_query("DELETE FROM messages WHERE ID='$id' AND `to_userid`='{$_SESSION['username']}'"); header('Location: http://mythscape.freezoka.com/pmindex.php'); } ?>
  10. Fantastic! Thanks.
  11. Okay. Thanks How do I get people to delete a PM?
  12. But my members don't have numerical IDs...well they do, but wouldn't it just be easier to select where to_userid = $_SESSION['username'] ? EDIT: I got it to work! How could I have members delete a PM, though?
  13. Nevermind! I got that part, now to see if it works.... What does this mean: What should I insert as the value of the sender? $_SESSION['username'] ?
  14. <?php //db_connect.php $con = mysql_connect("____","____","____") or die(mysql_error()); $db = mysql_select_db("zoka_3628910_messages",$con); function protect($string) { $string = mysql_real_escape_string($string); return $string; } ?> ???
  15. Anyone know why? ???
  16. I fooled with that ^ and got these: pm.php <?php include "db.php"; if(!$_POST['send']) { include ("sendpm.php"); } else { $subject = protect($_POST['subject']); $content = protect($_POST['content']); $to = protect($_POST['to']); if(!$subject || !$to || !$content) { $errors[] = "You did not fill out the required fields"; } else { $sql = "INSERT into messages (`to_userid` , `subject`,`content`) VALUES ('$subject','$content');"; $query = mysql_query($sql) or die(mysql_error()); echo "PM Sent"; echo "<a href=\"index.php\"> Home </a>"; } } print "From<br/> Subject<br/>Options<br/>"; $getmail="SELECT * from messages where `to_userid`='{$_SESSION['id']}'"; $getmail2=mysql_query($getmail) or die(mysql_error()); while($getmail3=mysql_fetch_array($getmail2)) { print "<a href='profile.php?username=$getmail3[from_userid]'>$getmail3[from_userid]</a><br/><a href='mail_msg.php?id=$getmail3[iD]'>$getmail3[subject]</a><br/><a href='?go=delete&id=$getmail3[iD]'>Delete</a><br/>"; } ?> But it tells me all the info, but then it says NO DATABASE SELECTED when I go to send a PM. Thanks.
  17. Okay, I do have a login/registration system. So if I add this: CREATE TABLE messages ( id IDENTITY(1,1) PRIMARY KEY, content text, sender varchar(35) ); It will create a database that can successfully store PMs, right?
  18. Yep. I think it's because I am using the host's free webhosting plan, but they will only allow mail to escape the site if I upgrade. I'm not sure because I've tried 4 different emails now and none work.
  19. What if you explained OpenBlog a little more so people don't need to take unto themselves the task of researching your site. I would assume people want to go, see what it's about, and decide whether they like it; not go, say WTF?, explore and research the site, and then decide whether or not they like it. Publishing false info is the same all around because you'll probably get like 60% of people who actually believe it. I would think with a large group of people you're more likely to get some people who think they know what they're talking about, but really have little or no clue.
  20. I was wondering how I could go about creating a very basic PM system...keep in mind, I am fairly new to PHP.
  21. Um...I think this should do it: Yours: <select name='show_email'><option selected='selected' value='no'>No</option><option value='yes'>Yes</option> <select name='show_age'><option selected='selected' value='no'>No</option><option value='yes'>Yes</option></select></select> Radio: <input type="radio" value="no" name="show_email" checked>No <br/> <input type="radio" value="yes" name="show_email">Yes <input type="radio" value="no" name="show_age" selected>No <br/> <input type="radio" value="yes" name="show_age">Yes
  22. I prefer using CSS containers rather than tables.
  23. Um...I don't have the prestige of other members, since I'm new here and all, but I looked at it and... ...it looks like it's a blog that just throws a million different things together. I looked at the home page and it was like..."Root Canals...Writing...Hacking..." I dunno, it just seemed so spasmodic to me because those subjects don't really flow or anything. They're just there. Plus, by allowing just anyone to write an entry don't you think you'd get some (a lot) of incorrect info? And isn't this board for commenting on design?
  24. I have a form that is giving me a tiny problem. I have this: <label for="rating">I Rate Mythscape...</label> <select id="rating" name="rating" value="<?php echo $row['rating']; ?>"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option></select> When someone edits their profile, it is supposed to automatically have a value of $row['rating'], which would be what they posted into the DB. However, when they edit their profile it always goes back to having a value of 1....how can I make it so that they do not need to physically change that field every time they edit? ???
×
×
  • 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.