Jump to content


Photo

Php Link Manipulation


  • Please log in to reply
1 reply to this topic

#1 phpnewbie05

phpnewbie05
  • Members
  • Pip
  • Newbie
  • 2 posts

Posted 29 June 2006 - 10:32 PM

Hello,

I need help with this: I have a [true/false] answer pulled from a mysql database and displayed in html. Now, I want to php to write a link next to it(the answer) that will flip the answer to false/update the table and rewrite the new url to flip it back to the original case. Anyhelp on this would be great.
Example:

Want More: Yes <== Now

Want More: Yes [a href=\"http://stuff\" target=\"_blank\"]No?[/a] <== Once clicked, it will be
No [a href=\"http://stuff\" target=\"_blank\"]yes?[/a]



Thanks in advance.

#2 mitzleah

mitzleah
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts
  • LocationManila, Philippines

Posted 06 July 2006 - 12:31 AM

Hey,

You have to have a conditional statement here. Put a Get Variable. For example:

if ($_GET['status'] == 'No') {
  print 'No  [a href=\"http://stuff\?status=Yes" target=\"_blank\"]yes?[/a]';
} else {
  print 'Yes [a href=\"http://stuff\?status=No" target=\"_blank\"]No?[/a]';
}

Hope I'm getting you. Hope this one will help!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users