Jump to content

If action


Canman2005

Recommended Posts

Hi all

Has anyone ever run into problems using the action query such as

[code]if ($action == "delete" && $id != "")
{[/code]

For some reason the web server I am using doesnt understand what the action is and simply ignores it, executing the first sql statement it can find on the page.

Any ideas would be great.

Thanks

Ed

Link to comment
https://forums.phpfreaks.com/topic/4260-if-action/
Share on other sites

[!--quoteo(post=352251:date=Mar 6 2006, 09:52 PM:name=Gaia)--][div class=\'quotetop\']QUOTE(Gaia @ Mar 6 2006, 09:52 PM) [snapback]352251[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Where are you getting the value of $action from?
[/quote]


Via the form, so the form action might look like

<form id="form" method="post" action="page.php?action=delete">
Link to comment
https://forums.phpfreaks.com/topic/4260-if-action/#findComment-14808
Share on other sites

For this case you would need to use "$_POST['action']"

This has all of the standard problems that indicate that this is a gregister_globals enabled vs. disabled problem.

You should always program your scripts assuming that [a href=\"http://www.php.net/register_globals\" target=\"_blank\"]register_globals[/a] is disabled.

Ken
Link to comment
https://forums.phpfreaks.com/topic/4260-if-action/#findComment-14846
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.