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
pleigh
Forum Contributor
Posts: 445 Joined: Wed Jan 19, 2005 4:26 am
Post
by pleigh » Mon Mar 14, 2005 1:29 am
i am attaching this code to a link...
Code: Select all
?mode=edit&post=$_GETї'the post id']
but during runtime, when i move the mouse over the link.....this is what i get
editreport.php?mode=edit&post=$_GET['the post id']
under the post id it doesnt display the right post id of the link...
this is my db query
what should i do?
Code: Select all
$query = "SELECT userID, postID FROM posts WHERE userID='$uid' AND postID='$id'";
$result = @mysql_query($query) or die(mysql_error());
feyd | Please use Code: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
JayBird
Admin
Posts: 4524 Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:
Post
by JayBird » Mon Mar 14, 2005 2:54 am
show the code where you generate the link
pleigh
Forum Contributor
Posts: 445 Joined: Wed Jan 19, 2005 4:26 am
Post
by pleigh » Mon Mar 14, 2005 3:02 am
thanks for the reply pimp...here's my code....
Code: Select all
$uid = $_SESSION['userID'];
$id = $_GET['pid'];
$query = "SELECT userID, postID FROM posts WHERE userID='$uid' AND postID='$id'";
$result = @mysql_query($query) or die(mysql_error());
if (mysql_fetch_assoc($result))
{
echo '<a href="reportedit.php?eid=$_GET[$id]" class=under>EDIT</a>';
}
else
{
NULL;
}
feyd | Please use Code: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
JayBird
Admin
Posts: 4524 Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:
Post
by JayBird » Mon Mar 14, 2005 3:07 am
this line
Code: Select all
echo '<a href="reportedit.php?eid=$_GET[$id]" class=under>EDIT</a>';
should be
Code: Select all
echo '<a href="reportedit.php?eid='.$_GET[$id].'" class=under>EDIT</a>';
shouldn't you have $_GET["id"] and not $_GET[$id] maybe
pleigh
Forum Contributor
Posts: 445 Joined: Wed Jan 19, 2005 4:26 am
Post
by pleigh » Mon Mar 14, 2005 3:38 am
thanks pimp...it worked...
Code: Select all
echo '<a href="reportedit.php?eid='.$_GET[$id].'" class=under>EDIT</a>';
i changed the $_GET[$id] to $_GET['pid'] where pid is the post id....
feyd | Please use Code: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Mar 14, 2005 8:33 am
pleigh, you seriously need to read and understand the Posting Code in the Forums thread. A link is provided in all your posts in this thread, along with in my signature.