Cetanu
Members-
Posts
395 -
Joined
-
Last visited
Never
Everything posted by Cetanu
-
Anyone have ANY idea why this won't work? :'(
-
Okay, thanks for the feedback. I'm gonna keep an eye out for that kind of thing.
-
Thanks But: It still echoes "Not Deleted" no matter what. And, the account doesn't get deleted.
-
I don't get the second part... Would this work: <input type="hidden" name="radio" value="no"/>No<br/> ?
-
That's okay I think I've tried everything. It's pro'lly just a stupid little mistake.
-
I think I completely massacred this form, but you know, I'm learning. I just want it to delete a user's account after they check yes or no... <fieldset style="padding: 10px;"> <legend>Delete Account: <?php echo "{$_SESSION['username']}"; ?></legend> <form action="daccount.php" method="get"> <input type="radio" name="yes" value="Delete Account"/>Yes<br/> <input type="radio" name="no" value="No"/>No<br/> <input type="submit" value="Submit" name="Submit"/> </form> </fieldset> <?php include "db.php"; if($_GET['Delete Account'] && $_GET['Submit']){ $sql = "DELETE FROM users WHERE `id`={$_GET['id']} AND `username`={$_SESSION['username']}"; $query = mysql_query($sql) or die(mysql_error()); echo " Hope you enjoyed MythScape. Sorry you un-registered."; echo "<a href=\"index.php\"> Click here </a> to Go Home"; } else{ echo "Not deleted!"; } ?> What it's doing is: -Allowing me to highlight yes AND no... -Echoing "Not Deleted" before anything is checked or submitted. -Not deleting the account.
-
Any ideas on this?
-
Just looking at it from the standpoint of someone who can't understand ActionScript to save their life, I would say having the var home:Index; thingy and the other code used for purpose of design sort of detracts. Someone who has no idea what code is would be like, WTF is var home:Index;!?!?! Though I'm sure they'd figure it out
-
I've got this code and I just need to know why it won't display. What have I done wrong? I made the if...else... statement myself, so it's probably around there. <?php $result = mysql_query("SELECT * FROM users") or die(mysql_error()); echo "<b>Username</b><br/>"; while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo "<table width='100%'>"; echo "<tr><td width='33%'>"; echo $row['username']; echo "</td>"; echo " <td width='33%'>| <a href=\"profile.php?username=".$row['username']."\">Profile</a> | </td>"; echo "<td width='33%'>"; if (($row['username'])=={($_SESSION['username'])}){ echo "This is YOU."; } else{ echo "Click to read more about" .$row['username'].; echo "</td></tr></table>"; } } ?>
-
Okay, I have added some dashed borders around the text in the sidebar. Can you tell me if that helps or if it would be better to change the background color? Thanks.
-
So it's like the whole middle area is just one color, but there should be definition between content and the sidebar? I'll look into borders or different background color. Thanks
-
Margin: Okay, I fixed it; better? Header: I know, I have to find time to make a new banner because that one was meant for something else. I don't like its dimensions either.
-
Okay guys, I just upgraded the site to it's version 2.0! I really want to know what you think of it now! http://mythscape.freezoka.com
-
Okay, someone's going to need to help me before I through some swords through my laptop screen and then chuck the carcass of the computer at my little brother. This PM script WILL NOT work and I've spent 2 hours on it. I cannot fix it! <?php session_start(); include "db.php"; switch($_GET['sa']){ default: inbox(); break; case 'send': send(); break; case 'sent': sent(); break; case 'msg': msg(); break; } echo"<br /> <a href='pmindex.php'>Inbox</a><br/> <a href='pmindex.php?action=messages&sa=send'>Compose</a> <br />"; function inbox(){ print " <br/><h2>Inbox</h2><table width='100%' class='content'>"; print "<tr><td width='35%'><h3>From</h3></td><td width='55%'><h3>Subject</h3></td><td><h3>Content</h3></td></tr>"; $m=mysql_query("SELECT * FROM messages WHERE `to_userid`='{$_SESSION['username']}'") or die(mysql_error()); while($mail=mysql_fetch_array($m)) { $from=$mail['from_userid']; $id=$mail['id']; $subject=$mail['subject']; echo "<tr><td><a href='profile.php?username=$from'>$from</a></td><td><a href='pmindex.php?action=messages&sa=msg&id=$id'>$subject</a></td>"; echo $_POST['content']; echo "<br/><br/><td><a href='pmindex.php?action=messages&go=delete'>Delete</a></td></tr>"; } echo "</table>"; } function msg(){ $id=$_GET['id']; print "<table>"; $ms=mysql_query("SELECT * FROM messages WHERE `to_userid`='{$_SESSION['username']}' AND `id`='$id'") or die(mysql_error()); $mamessage=$ms[content]; $msubject=$ms[subject]; $from=$ms[from_userid]; echo "$msubject<br />"; echo "<b>Sent By:</b> <a href='pmindex.php?action=profile&username=$from'>$from</a><br/> <b>Message:</b><br/> $mamessage</div><br/>"; print "</table>"; if($_POST['reply']){ $message=$_POST['content']; $subject=$_POST['subject']; $to=$_POST['from_userid']; $reply="INSERT INTO messages SET `from_userid`='{$_SESSION['username']}',`to_userid`='$to',`subject`='$subject',`content`='$message',`id`='$id'"; mysql_query($reply) or die("Could not reply"); echo'<div class="done">Message Sent!</div><br />'; } echo "<table><div class='header'>Reply</div><br />"; echo "<form action=\"pmindex.php?action=messages&sa=msg&id=$id\" method=\"post\"> <div class='content'> Subject:<br> <input type='text' name='subject' size='20' value='Re: $subject'><br> Message:<br> <textarea name='content' rows='6' cols='40'></textarea><br> <input type='submit' name='reply' value='Reply'></form></div></table>"; } function send(){ if($_POST['send']){ $to=$_POST['to_userid']; $message=$_POST['content']; $subject=$_POST['subject']; $to=$_POST['to_userid']; $send="INSERT INTO messages SET `from_userid`='{$_SESSION['username']}',`to_userid`='$to',`subject`='$subject',`content`='$message'"; mysql_query($send) or die(mysql_error()); echo "Message Sent!<br />"; } print "<table> <div class='header'>Send</div><br />"; $to=$_GET['to_userid']; echo "<form action=\"pmindex.php?action=messages&sa=send\" method=\"post\"> To:<br> <input type='text' name='to_userid' size='20' value='$to'><br/> Subject:<br> <input type='text' name='subject' size='20'><br> Message:<br> <textarea name='content' rows='6' cols='40'></textarea><br> <input type='submit' name='send' value='Send'></form></table>"; } ?> <? 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']}'"); echo "Message Deleted!"; } ?> Messages can be SENT and RETRIEVED if they are sent, BUT they cannot be replied to, deleted, and the content of the message won't show up. -.- Help is greatly appreciated.
-
So, wait: I did this: <p style="font-size: 1.5em; font-style: italic;"><?php $tag=strip_slashes($row['tagline']); echo $tag; ?></p> And what it does is kill the page content after that ^ And I don't get the post on mysql_real_escape_string();
-
When I have users type their "about me" section, if they use " or ' it comes out \" I was telling them to use ’ for a while, but then I used htmlentities to prevent malicious attacks. How can I make it so " or ' is displayed properly?
-
Cha, but I changed it to accommodate my members. The profiles have more fields and stuff. Any luck with this problem?
-
Me neither. That didn't work. :-\ How do you know I'm using the same login?!
-
db.php <?php //db_connect.php $con = mysql_connect("-----","------","------") or die(mysql_error()); $db = mysql_select_db("zoka_3628910_users",$con) or die('Error: '.mysql_error()); function protect($string) { $string = mysql_real_escape_string($string); return $string; }?>