Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Problem with variables

Featured Replies

Below is a sample of a very simple form with one drop down menu. The form posts back to itself, with some php to process the user entry. When the user select "2", I want the variable "test" to be set. But when the user selects "1" I do not want the variable to be set. This works fine when I test it on my local host, but when I upload it to my production server, the variable is always set. If the user selects "1", $test is set to "1" despite the fact that my "if" statement include &&($_POST['test']!="1")!!! Any ideas??

 

 
<body>
<?php
	if (isset ($_POST['test'])&&($_POST['test']!="1"))
		{
		$test=$_POST['test'];
		}
	echo $test
?>	
<form method="post" action="testing.php">
	<select name="test">
		<option value="1">1</option>
		<option value="2">2</option>
	</select>
	<input name="submit" type="submit" value="GO!" />
</form>
</body>

Looks like your production server has 'register_globals' enabled.

Do you have control over your production server? If so, change the register_globals line in php.ini to Off.

Failing that, create a .htaccess file in the root folder of your web space and use the following:

php_flag register_globals  off

  • Author

Looks like your production server has 'register_globals' enabled.

Do you have control over your production server? If so, change the register_globals line in php.ini to Off.

Failing that, create a .htaccess file in the root folder of your web space and use the following:

php_flag register_globals  off

I'll look into that.

But what about that die() problem. When I add it to the php, the rest of the page seems to die as well, even all of the html outside of the php block

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.