Jump to content

Php Link Manipulation


phpnewbie05

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.
Link to comment
https://forums.phpfreaks.com/topic/13259-php-link-manipulation/
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!
Link to comment
https://forums.phpfreaks.com/topic/13259-php-link-manipulation/#findComment-53638
Share on other sites

Archived

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

×
×
  • Create New...

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.