List Info

Thread: PHP 5 and isset()?




PHP 5 and isset()?
user name
2006-12-13 01:04:11
I have a script that works fine on PHP 4.

The function is a form that submits to itself and at the top
of the
page is below and the form has a submit button named
"submit button"

if(isset($_POST['submit_button'])){
}


The problem is that on PHP Version 4 the submit button works
fine and
the page goes into the if statement, however on PHP Version
5.1.2, the
value isn't recognized as being set.

I can echo the variable to the page and it will display but
is there
some known issue in PHP5 that might not be picking this up
or is there
an alternate way to code this? I have tried setting the
variable to a
local variable and also the GET method and still no joy.

Thanks
Bry


--~--~---------~--~----~------------~-------~--~----~
This group is managed and maintained by the development
staff at 360 PSG. An enterprise application development
company utilizing open-source technologies for todays
small-to-medium size businesses.

For information or project assistance please visit :
http://www.360psg.com

You received this message because you are subscribed to the
Google Groups "Professional PHP Developers" group.
To post to this group, send email to Professional-PHPgooglegroups.com
To unsubscribe from this group, send email to
Professional-PHP-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups.google.com/group/Professional-PHP
-~----------~----~----~----~------~----~------~--~---

PHP 5 and isset()?
user name
2006-12-13 01:08:10
Is the underscore a typo here or in the script?
 
Ian
On 13/12/06, Boxxa < bryan.benwaygmail.com">bryan.benwaygmail.com> wrote:

I have a script that works fine on PHP 4.

The function is a form that submits to itself and at the top of the
page is below and the form has a submit button named "submit button&quot;

if(isset($_POST['submit_button'])){
}


The problem is that on PHP Version 4 the submit button works fine and
the page goes into the if statement, however on PHP Version 5.1.2, the
value isn't recognized as being set.

I can echo the variable to the page and it will display but is there
some known issue in PHP5 that might not be picking this up or is there
an alternate way to code this? I have tried setting the variable to a
local variable and also the GET method and still no joy.

Thanks
Bry






--~--~---------~--~----~------------~-------~--~----~
This group is managed and maintained by the development staff at 360 PSG. An enterprise application development company utilizing open-source technologies for todays small-to-medium size businesses.

For information or project assistance please visit :
http://www.360psg.com

You received this message because you are subscribed to the Google Groups "Professional PHP Developers" group.
To post to this group, send email to Professional-PHPgooglegroups.com
To unsubscribe from this group, send email to Professional-PHP-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/Professional-PHP
-~----------~----~----~----~------~----~------~--~---

PHP 5 and isset()?
user name
2006-12-13 05:27:28
isset still works in PHP5.  make sure submit_button has a
value.  if it
doesn't (i.e., the submit button is rendered as default), it
may not be
getting sent over, similar to the way checkboxes aren't sent
unless
they are set to "on".

also, i'm sure you've done it, but make sure your form has a
method and
that it is set to post.


--~--~---------~--~----~------------~-------~--~----~
This group is managed and maintained by the development
staff at 360 PSG. An enterprise application development
company utilizing open-source technologies for todays
small-to-medium size businesses.

For information or project assistance please visit :
http://www.360psg.com

You received this message because you are subscribed to the
Google Groups "Professional PHP Developers" group.
To post to this group, send email to Professional-PHPgooglegroups.com
To unsubscribe from this group, send email to
Professional-PHP-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups.google.com/group/Professional-PHP
-~----------~----~----~----~------~----~------~--~---

PHP 5 and isset()?
user name
2006-12-14 05:48:17
Here is the page

If i echo $_POST['submit_button'] it shows the assigned
value but it
wont go into the if statement for some reason.


<?
session_start();
include('functions.php');
$button_press = $_POST['del_image'];
if(isset($button_press)){
while (list ($key,$val) = each ($box)) {
$query = mysql_query("DELETE FROM images WHERE
image_path='$val'");
unlink($val);
}
}
checkLogin();
drawHeader();
?><br>
<br>
<br>
<center>
<form action="edit_images.php"
method="POST">
<table width="50%" border="1">
<tr>
	<td
align="center"><strong>Category</stron
g></td>
	<td
align="center"><strong>Filename</stron
g></td>
	<td
align="center"><strong>Preview</strong
></td>
	<td
align="center"><strong>Delete</strong&
gt;</td>
</tr>
<?
include('db_connect.php');
$query = mysql_query("SELECT * FROM images ORDER BY
category ");

while($row = mysql_fetch_array($query)){

	echo "<tr
align="center"><td>".
$row['category']."</td>";
	echo "<td align="center">" .
$row['image_name'] . "</td>";
	echo "<td align="center"><img
width="100px" src="" .
$row['image_path'] .
""></img></td>";
	echo "<td align="center"><input
type="checkbox" name="box[]"
value="" . $row['image_path'] .
""></td></tr>";
}
?>
</table><br />

<input type="submit" name="del_image"
value="Delete Selected">
</form>
</center>


--~--~---------~--~----~------------~-------~--~----~
This group is managed and maintained by the development
staff at 360 PSG. An enterprise application development
company utilizing open-source technologies for todays
small-to-medium size businesses.

For information or project assistance please visit :
http://www.360psg.com

You received this message because you are subscribed to the
Google Groups "Professional PHP Developers" group.
To post to this group, send email to Professional-PHPgooglegroups.com
To unsubscribe from this group, send email to
Professional-PHP-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups.google.com/group/Professional-PHP
-~----------~----~----~----~------~----~------~--~---

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )