Jump to content

Archived

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

phpnewbie05

Php Link Manipulation

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Hey,

You have to have a conditional statement here. Put a [color=red]Get Variable[/color]. For example:

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

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

Share this post


Link to post
Share on other sites

×

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.