Wondering why "<?=$PHP_SELF;?>" does not seem to be working for me on this particular server. On other installations it works fine. Is there a PHP configuration parameter I don't know about that need to set?
<h1> Search v2.1</h1>
<p>
<form action="<?=$PHP_SELF;?>" method="get">
<p>
Select Protocol/Apps: <select name="apps">
<option value=" ">Choose</option>
<option value="http">HTTP</option>
<option value="dns">DNS</option>
...
Thank you in advance.
<form action="<?=$PHP_SELF;?>" method="get"> does not work
Moderator: General Moderators
Re: <form action="<?=$PHP_SELF;?>" method="get"> does not work
TRy
Code: Select all
<?php echo $_SERVER['PHP_SELF']; ?>Re: <form action="<?=$PHP_SELF;?>" method="get"> does not work
Actually, use SCRIPT_NAME. Using PHP_SELF opens yourself up to various attacks.
$PHP_SELF was created automatically because of register_globals. Which is a bad thing so don't use it.
Code: Select all
<?php echo $_SERVER['SCRIPT_NAME']; ?>Re: <form action="<?=$PHP_SELF;?>" method="get"> does not work
Hmm, this works good. Wondering why my other syntax (<form action="<?=$PHP_SELF;?>" method="get">
) worked in one case but not in another...
Even tried <form action="<?php =$PHP_SELF;?>" method="get">
) worked in one case but not in another...
Even tried <form action="<?php =$PHP_SELF;?>" method="get">
Re: <form action="<?=$PHP_SELF;?>" method="get"> does not wo
Question:
When $PHP_SELF is set, register_globals (in php.ini) is on. When only $_SERVER['PHP_SELF'] is set, register_globals is off.
Edit: This post was recovered from search engine cache.
Answer:jdmfontz wrote:Wondering why my other syntax (<form action="<?=$PHP_SELF;?>" method="get">
) worked in one case but not in another...
Clarification:tasairis wrote:$PHP_SELF was created automatically because of register_globals. Which is a bad thing so don't use it.
When $PHP_SELF is set, register_globals (in php.ini) is on. When only $_SERVER['PHP_SELF'] is set, register_globals is off.
Edit: This post was recovered from search engine cache.
Last edited by McInfo on Mon Jun 14, 2010 4:09 pm, edited 1 time in total.
Re: <form action="<?=$PHP_SELF;?>" method="get"> does not work
The =$var method (echo's "short(cut) syntax") only works with short tags. Sojdmfontz wrote:Even tried <form action="<?php =$PHP_SELF;?>" method="get">
Code: Select all
<?php =$PHP_SELF; ?>