Dificult time including stuff to the webpage....

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Bruski
Forum Newbie
Posts: 13
Joined: Fri Jul 11, 2003 11:23 am

Dificult time including stuff to the webpage....

Post by Bruski »

im currently using a different include code than the traditional <php include ('file') ?> command ....

Code: Select all

<? 
	if(isset($_GET&#1111;'id']) && $_GET&#1111;'id'] != "")&#123;
		$id= $_GET&#1111;'id'];
	&#125;else&#123;
		$id= "";
	&#125;
	
	if($id=="")&#123;
		include('../cgi-bin/cutenews/show_news.php');
	&#125;else&#123;
		$include= $_GET&#1111;'id'];
		include("$include.php");
	&#125;
?>
i have this member posting site where i can add delete and modify the members page, but when i try to use this include to execute those commands, the add will show in the website but the rest wont...and all of them dont do what they are supposed to do....for example delete doesnt delete add goes to the add page but doesnt add members,... here is the code for the 3 links

Code: Select all

echo "<br> <a href=roster.php?action=delete&id=$key>Delete</a>\n";
    echo "<a href=roster.php?action=edit&id=$key>Edit</a>\n";
    echo "<a href=addmem.php>Add</a>\n";
any help would be greatly appreciated
Tubbietoeter
Forum Contributor
Posts: 149
Joined: Fri Mar 14, 2003 2:41 am
Location: Germany

Post by Tubbietoeter »

first of all,
echo "<a href=roster.php?action=edit&id=".$key.">Edit</a>\n";
would be better

then, this:
$include= $_GET['id'];
include("$include.php");
might be problematic too. change it to:
include($id.".php");



maybe that was it. never print variables directly into strings, always concatenate
Post Reply