Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.