NYCPHP Meetup

NYPHP.org

[nycphp-talk] Can't get no $action

Derek DeVries derek at sportspyder.com
Mon Apr 26 09:42:29 EDT 2004


Only double quotes are compatible with the newest standard of XHTML.

---------------
Derek DeVries
http://www.sportspyder.com



----- Original Message ----- 
From: "leam" <leam at reuel.net>
To: "NYPHP Talk" <talk at lists.nyphp.org>
Sent: Monday, April 26, 2004 9:36 AM
Subject: Re: [nycphp-talk] Can't get no $action


> Dan Cech wrote:
> > leam wrote:
>
> >>  From the editor_form function:
> >>
> >>     echo "<form name=edit_form method=post action=$PHP_SELF >";
> >>     echo "<input type=hidden name=action value=save_file >";
> >>     echo "<input type=submit value='Save and Exit' name=submit>";
> >
> >
> > It won't be causing the problem, but your html should be properly
quoted.
>
> Do you mean like:
> echo "<input type=\"hidden\">";
>
> or can I use single quotes? Yeah, I'm still on the square part of the
> learnin' curve...
>
> >
> >>  From the switch statement:
> >>
> >>     switch($action) {
> >>         case "save_file":
> >>             save_file();               break;
> >>         default:
> >>             html_header();               editor_form();
> >>             html_footer();
> >>     }
> >>
> >> The save_file function works if it's called by itself, and the $action
> >> just seems to call the default.
> >
> >
> > I would suggest that your server might have register_globals turned off,
> > meaning you will need to use $_POST['action'] instead of $action.  You
> > should do this anyway, rather than relying on register_globals.
> >
> > Dan
>
> Virtual Drink to you, that was it! Went to switch($_POST[action]) and it
> worked.
>
> The book recommends register_globals be on but I've understood that is
> not the best solution. However, I still get mixed up in their code
> becasue they're using it that way.
>
> Thanks!
>
> leam
>
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
>





More information about the talk mailing list