adamlacombe Posted July 10, 2009 Share Posted July 10, 2009 yeah that can be pretty annoying that session_start(); try doing a switch so your index file will look something like: <? include "includes/db.php"; session_start(); switch($_GET['action']){ case 'login': include ('pages/login.php'); break; case 'logout': include ('pages/logout.php'); break; case 'register': include ('pages/register.php'); break; case 'profile': include ('pages/profile.php'); break; case 'profilecp': include ('pages/profilecp.php'); break; case 'messages': include ('pages/messages.php'); break; case 'members': include ('pages/members.php'); break; default: include ('pages/main.php'); break; } ?> much easier I find, I have spent hours once trying to figure out why my query wouldnt work lol and if everything if fixed "topic solved" on the left bottom, click it. oh and also, if you want to switch hosting company's.. I find freehostia works wonders, check em out. Quote Link to comment Share on other sites More sharing options...
Cetanu Posted July 10, 2009 Author Share Posted July 10, 2009 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... Quote Link to comment Share on other sites More sharing options...
adamlacombe Posted July 10, 2009 Share Posted July 10, 2009 for example: http://blah.com/index.php?action=messages the switch will make it so basically you dont have to include your db.php file, session_start();, header, footer etc.. in every single file you have. a little bit easier and less coding in your files. Quote Link to comment Share on other sites More sharing options...
Cetanu Posted July 10, 2009 Author Share Posted July 10, 2009 I'll look into that. Thanks. Quote Link to comment Share on other sites More sharing options...
Cetanu Posted July 10, 2009 Author Share Posted July 10, 2009 Hehe, it works, but guess what: the messages don't get deleted! XD Quote Link to comment Share on other sites More sharing options...
adamlacombe Posted July 10, 2009 Share Posted July 10, 2009 great... lol. umm.... what does your code look like? and u have the switch working? Quote Link to comment Share on other sites More sharing options...
Cetanu Posted July 10, 2009 Author Share Posted July 10, 2009 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'); ?> Quote Link to comment Share on other sites More sharing options...
adamlacombe Posted July 10, 2009 Share Posted July 10, 2009 look at ur database and make sure sure that id is ID in capitals, if its not in caps then u need to switch the query to: mysql_query("DELETE FROM messages WHERE `id`='$id' AND `to`='{$_SESSION['username']}'"); that may be the prob. Quote Link to comment Share on other sites More sharing options...
Cetanu Posted July 10, 2009 Author Share Posted July 10, 2009 Changed it. No luck. Could it be that there is no switch? Quote Link to comment Share on other sites More sharing options...
adamlacombe Posted July 10, 2009 Share Posted July 10, 2009 no thats isnt that prob... umm let me think. Quote Link to comment Share on other sites More sharing options...
adamlacombe Posted July 10, 2009 Share Posted July 10, 2009 is db.php the file that has your mysql_connect()? and what is a link that you're using to delete? something like http://blah.com/deletepm.php?id=5 ? Quote Link to comment Share on other sites More sharing options...
Cetanu Posted July 10, 2009 Author Share Posted July 10, 2009 Yes. Quote Link to comment Share on other sites More sharing options...
adamlacombe Posted July 10, 2009 Share Posted July 10, 2009 you said you couldnt change to_userid to "to" yet, right? well if so then your query should be: mysql_query("DELETE FROM messages WHERE `ID`='$id' AND `to_userid`='{$_SESSION['username']}'"); is that the prob? Quote Link to comment Share on other sites More sharing options...
Cetanu Posted July 10, 2009 Author Share Posted July 10, 2009 LtfOL, no I did that. Quote Link to comment Share on other sites More sharing options...
Cetanu Posted July 10, 2009 Author Share Posted July 10, 2009 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; }?> Quote Link to comment Share on other sites More sharing options...
adamlacombe Posted July 10, 2009 Share Posted July 10, 2009 You're using the same login system as me try this: $con = mysql_connect("-----","------","------") or die(mysql_error()); $db = mysql_select_db("zoka_3628910_users",$con); I dont think it has to do with the db but... Im very confused.. I dont see what could be causing it to not delete them. Quote Link to comment Share on other sites More sharing options...
Cetanu Posted July 10, 2009 Author Share Posted July 10, 2009 Me neither. That didn't work. :-\ How do you know I'm using the same login?! Quote Link to comment Share on other sites More sharing options...
adamlacombe Posted July 10, 2009 Share Posted July 10, 2009 I checked out ur site and the register page looked the same and in the about section it has tell us about yourself.. and also your db.php has db_connect.php on the top (original file name) lastly the protect function. http://bhaviksblog.com/02/php-login-system-tutorial-part-3/ am I correct? Quote Link to comment Share on other sites More sharing options...
Cetanu Posted July 10, 2009 Author Share Posted July 10, 2009 Cha, but I changed it to accommodate my members. The profiles have more fields and stuff. Any luck with this problem? Quote Link to comment Share on other sites More sharing options...
adamlacombe Posted July 10, 2009 Share Posted July 10, 2009 not really... Ill tell ya what, i will PM you my whole messaging file, it has everything all in one file. Quote Link to comment Share on other sites More sharing options...
Cetanu Posted July 10, 2009 Author Share Posted July 10, 2009 Sounds good. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.