|
-
Jun 7th, 2002, 02:16 PM
#1
Thread Starter
Addicted Member
form actions
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!
-
Jun 7th, 2002, 03:04 PM
#2
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
-
Jun 7th, 2002, 03:26 PM
#3
Fanatic Member
i think he means:
<form method="post" action="<? echo "$PHP_SELF";?>">
-
Jun 7th, 2002, 03:33 PM
#4
Stuck in the 80s
I thought he meant actually putting code in there:
Code:
<form action=" <?php echo $_REQUEST['num'] + 1; ?>">
In that case, no.
-
Jun 7th, 2002, 03:34 PM
#5
Stuck in the 80s
Originally posted by cpradio
i think he means:
<form method="post" action="<? echo "$PHP_SELF";?>">
*cough cough* $_SERVER['PHP_SELF']; *ahem*
-
Jun 7th, 2002, 03:37 PM
#6
hehe good catch, I'm slipping, but also if that is what he meant.
-
Jun 7th, 2002, 03:38 PM
#7
Fanatic Member
Originally posted by The Hobo
*cough cough* $_SERVER['PHP_SELF']; *ahem*
What a suck up Nonetheless, it works if you use ini_set("register_globals",1); at the top of your code.
-
Jun 7th, 2002, 03:41 PM
#8
By the way:
Is there a reason to use action="<?php echo $_SERVER['PHP_SELF']; ?>" instead of action="#" ?
-
Jun 7th, 2002, 03:48 PM
#9
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.
-
Jun 7th, 2002, 04:06 PM
#10
Stuck in the 80s
Originally posted by cpradio
What a suck up Nonetheless, it works if you use ini_set("register_globals",1); at the top of your code.
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.
-
Jun 7th, 2002, 04:07 PM
#11
Stuck in the 80s
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.
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.
But okay, I'm wrong
-
Jun 7th, 2002, 04:11 PM
#12
lol 
where is [praetorian] in all this??
-
Jun 7th, 2002, 05:45 PM
#13
Fanatic Member
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.
lol, i know. I am just giving you a hard time b/c I keep forgetting about them shutting it off.
-
Jun 7th, 2002, 05:51 PM
#14
Stuck in the 80s
Geez...next you'll be running around cloning things.
-
Jun 7th, 2002, 08:11 PM
#15
Fanatic Member
Hey! no one is supposed to know that I am experimenting with cloning.
-
Jun 8th, 2002, 05:16 AM
#16
Thread Starter
Addicted Member
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.....
-
Jun 8th, 2002, 09:07 AM
#17
Stuck in the 80s
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.
-
Jun 8th, 2002, 09:56 AM
#18
Fanatic Member
You can do the following though:
PHP Code:
<form method="post" action="<?php echo$_SERVER['SCRIPT_NAME']."?num=".$_REQUEST['num'] + 1; ?>">
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|