Jump to content

PM System


Cetanu

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/164813-pm-system/page/2/#findComment-873029
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/164813-pm-system/page/2/#findComment-873037
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/164813-pm-system/page/2/#findComment-873039
Share on other sites

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');
?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/164813-pm-system/page/2/#findComment-873156
Share on other sites

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;
}?>

Link to comment
https://forums.phpfreaks.com/topic/164813-pm-system/page/2/#findComment-873175
Share on other sites

You're using the same login system as me  :o

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.

Link to comment
https://forums.phpfreaks.com/topic/164813-pm-system/page/2/#findComment-873186
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/164813-pm-system/page/2/#findComment-873193
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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