extra optie tot mijn inlog scripts

Status
Niet open voor verdere reacties.
zal wel verkeerd doen die print inbox maar wat ik ook niet begrijp is dat dat table niet gezien word
 
Gooi die regel nou eens in je while-loop van je inbox.
Wat staat er dan?
 
Gewoon die functie neerpoten, en kijken wat je ziet. Heb je geen totaalplaatje voor nodig. ;)
 
Notice: Undefined index: user_id in /home/moffia/domains/moffia.nl/public_html/whatsappgroep/users/inbox.php on line 5
 
ik heb dit draaien hij vind niks meer

PHP:
<?php

// Turn off error reporting
error_reporting(0);

// Report runtime errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);

// Report all errors
error_reporting(E_ALL);

// Same as error_reporting(E_ALL);
ini_set("error_reporting", E_ALL);

// Report all errors except E_NOTICE
error_reporting(E_ALL & ~E_NOTICE);

session_start();
$user = $_SESSION['user_id'];

	
include '../lib/connections/db.php';
 
Jij weet ook niet wat je wilt?
Eerst zet je error reporting uit, dan zet je hem aan voor runtime errors, en dan opeens voor alles, en dan voor alles behalven notices?
Zet alles gewoon aan en controleer met isset() op het bestaan van $_SESSION['user_id']
 
ik ben dus achter dat u in hoftzaak alleen de pagina inbox niet draaid dat ik in het disng al foten zie die hij in script niet geenft
 
Dan wordt het toch maar eens debuggen, zet eens op diverse plekken in je code een specifieke echo neer, zodat je weet wat juist wel werkt, en wat juist niet.
Dan weet je precies waar je vast loopt, en dat laat je heir dan zien.

Scheelt ons lang zoeken in een ge-rar-d script.
 
dit is van af regel

dit is vanaf regel 54 dat het fout gaat
PHP:
<?php
	//This stuff and the while loop will query the database, see if you have messages or not, and display them if you do
	$query = "SELECT id, sender, subject, message FROM messages WHERE reciever='$user'";
	$sqlinbox = mysql_query($query);
	
	//We have a mysql error, we should probably let somone know about the error, so we should print the error
	if(!$sqlinbox)
		{
		?>
		<p><?php print '$query: '.$query.mysql_error();?></p>
		<?php
		}
	
	//There are no rows found for the user that is logged in, so that either means they have no messages or something broke, lets assume them they have no messages
	elseif (!mysql_num_rows($sqlinbox) )
		{
		?>
		<center><p><b>You have no messages to display</b></p></center>
		<?php
		}
	
	//There are no errors, and they do have messages, lets query the database and get the information after we make a table to put the information into
	else
		{
		//Ok, Lets center this whole table Im going to make just because I like it like that
		//Then we create a table 80% the total width, with 3 columns, The subject is 75% of the whole table, the sender is 120 pixels (should be plenty) and the select checkboxes only get 25 pixels
		?>
		<center>
		<form name="send" method="post" action="delete.php">
		<table width="80%">
		<tr>
		  <td width="75%" valign="top"><p><b><u>Subject</u></b></p></td>
		  <td width="120px" valign="top"><p><b><u>Sender</u></b></p></td>  
		  <td width="25px" valign="top"><p><b><u>Select</u></b></p></td>
		</tr>
		<?php
		//Since everything is good so far and we earlier did a query to get all the message information we need to display the information. 
		//This while loop goes through the array outputting all of the message information
		while($inbox = mysql_fetch_array($sqlinbox))
			{
			//These are the variables we get from the array as it is going through the messages, we have the id of the private message, we have the person who sent the message, we have the subject of the message, and yeah thats it
			$pm_id = $inbox['id'];
			$sender = $inbox['sender'];
			$subject = $inbox['subject'];
			
			//So lets show the subject and make that a link to the view message page, we will send the message id through the URL to the view message page so the message can be displayed
			//And also let the person see who sent it to them, if you want you can make that some sort of a link to view more stuff about the user, but Im not doing that here, I did it for my game though, similar to the viewmsg.php page but a different page, and with the senders id
			//And finally the checkboxes that are all stuck into an array and if they are selected we stick the private message id into the array
			//I will only let my users have a maximum of 50 messages, remeber that ok? Because that's the value I will later in another page
			//Here is finally the html output for the message data, the while loop keeps going untill it runs out of messages
			?>
           
			<tr>
			  <td width="75%" valign="top"><p><a href="viewmsg.php?msg_id=<?php echo $pm_id; ?>"><?php echo $subject; ?></a></p></td>
			  <td width="120px" valign="top"><p><?php echo $sender; ?></p></td>
			  <td width="25px" valign="top"><input name="pms[]" type="checkbox" value="<?php echo $pm_id; ?>"></td>
			</tr>
			<?php
			//This ends the while loop
			}
		//Here is a submit button for the form that sends the delete page the message ids in an array
		?>
		<tr>  
		<td colspan="3"><input type="submit" name="Submit" value="Delete Selected"></td>
		<td></td>
		<td></td>
		</tr>
		</table>
		</center>
		<?php
		//So this ends the else to see if it is all ok and having messages or not
		}
	
	//This ends that first thing that checks if you are logged in or not
	}
?>
dream.png foto hoe dream uit ziet het dsising
 
Dreamweaver is niet interessant. Die kan geen PHP uitvoeren, dan zul je het via een webserver moeten draaien.
 
stapje verder om dat

om dat in begin staat

PHP:
session_start();
$user = $_SESSION['user_id'];

zal regel 36 nooit werken aantal mail hoe vol die zit
stond op
PHP:
$sql = mysql_query ("SELECT pm_count FROM users WHERE username='$user'");
WHERE username veranderd in id
en hoe vol de mail box zit
nu de rest uit vogel dat zal ook wel zo iets zijn
 
En wat als die sessie niet bestaat? Dan moet je met isset kijken of die bestaat.
Als hij niet bestaat, ben je niet ingelogd, dus kan je dat in een foutmelding tonen, zo ja, dan ben je ingelogd, en toon je de inbox.

Verder is een username niet hetzelfde als een ID, dus je query moet je aanpassen naar id i.p.v. username.
usernames zijn alleen interessant om te tonen, je moet er geen controles op doen.
 
Laatst bewerkt:
is mijn allemaal tover werk zie ook in eens in verzend map wat nog niet op gevallen dat alle verzonden mails zie to een aantal van 4 stukjes
 
www.php.net/isset daar vind je de handleiding.
Verder raad ik je aan om je berichten door een spellingscontrole te halen of door iemand na te lezen voordat je het post. Ik snap er geen bal meer van...
Je wilt graag geholpen worden, maar probeer je vraag ook duidelijk te formuleren.
 
ergens in de eerste pagina inbox.php zit iets niet goed

1 verdacht dat ik gebruik moet maken van user_id om al in gelogt te zijn in inbox
2 door dat punt 1 gooit hij script door elkaar heen een gebruiker kan zien wat een ander naar die persoon verstuurd heeft
3 echt zonder dat script niet volgens de normale prcesdure werkt
 
Ik volg er weinig van met dat hak op de tak springerij.
Kom eens met een demo aan, en vertel wat er fout gaat en wat we daarvoor moeten doen.
 
Status
Niet open voor verdere reacties.
Steun Ons

Nieuwste berichten

Terug
Bovenaan Onderaan