hi!
need some professional help, so I turn to you guys and girls!
1) instead of using action="something.php" can I instead write a php-code on the spot? tried but failed....
thanks!
Printable View
hi!
need some professional help, so I turn to you guys and girls!
1) instead of using action="something.php" can I instead write a php-code on the spot? tried but failed....
thanks!
if you are using a form tag you have to have the action set to something or the browser will not know what to do. and what do you mean write php code on the spot
i think he means:
<form method="post" action="<? echo "$PHP_SELF";?>">
I thought he meant actually putting code in there:
In that case, no.Code:<form action=" <?php echo $_REQUEST['num'] + 1; ?>">
*cough cough* $_SERVER['PHP_SELF']; *ahem*Quote:
Originally posted by cpradio
i think he means:
<form method="post" action="<? echo "$PHP_SELF";?>">
hehe good catch, :) I'm slipping, but also if that is what he meant.
What a suck up :p Nonetheless, it works if you use ini_set("register_globals",1); at the top of your code.Quote:
Originally posted by The Hobo
*cough cough* $_SERVER['PHP_SELF']; *ahem*
By the way:
Is there a reason to use action="<?php echo $_SERVER['PHP_SELF']; ?>" instead of action="#" ?
ahem hobo.... $_SERVER['SCRIPT_NAME']; that is the preferred way. just like that no changing it to the actuall script name. :)
and twanvl, # is not preferred either.
I think there's a reason they shut it off, buddy. But go ahead...play God. As if it's hard to type a few extra characters anyways.Quote:
Originally posted by cpradio
What a suck up :p Nonetheless, it works if you use ini_set("register_globals",1); at the top of your code.
Some people prefer petite chicks. Some like the butts round and delicious. Some like the little melons, other's indulge themselves in watermelons. A matter of preference doesn't not pertain to the general public but to the individual.Quote:
Originally posted by scoutt
ahem hobo.... $_SERVER['SCRIPT_NAME']; that is the preferred way. just like that no changing it to the actuall script name. :)
and twanvl, # is not preferred either.
But okay, I'm wrong :p
lol :D
where is [praetorian] in all this??
lol, i know. I am just giving you a hard time b/c I keep forgetting about them shutting it off.Quote:
Originally posted by The Hobo
I think there's a reason they shut it off, buddy. But go ahead...play God. As if it's hard to type a few extra characters anyways.
Geez...next you'll be running around cloning things. :p
Hey! no one is supposed to know that I am experimenting with cloning. :p
so you can't write <form action=" <?php echo $_REQUEST['num'] + 1; ?>"> ?!
scoutt: haven't answered earlier because I've been asleep, got a nasy hang over.......nah, just kidding.....
No you can't. because then that's going to be read as:
<form action="1">
or if you have a value already set for num, it'll have that value + 1 in there. All this will happen as the page is being sent to the browser. So no, it won't work.
You can do the following though:
PHP Code:<form method="post" action="<?php echo$_SERVER['SCRIPT_NAME']."?num=".$_REQUEST['num'] + 1; ?>">