FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Contact Form without Global Variables





RealisTECHSolutions
I have been building this website and the server I have it uploaded to has limited PHP support. Specifically they have register_globals=off.

My question is, Is there a way around the global variables and create a contact form?

I have found a couple of walk throughs online, but i have not had success with it yet. If there is a way to create a contact form without PHP, I would be interested in hearing about that as well.

Thank you for your help on this.
Peterssidan
Depending on what method is used to send the form data use $_POST or $_GET to access the form data.

Code:
<form action="" method="post">
Name: <input type="text" name="name"><br>
Age: <input type="text" name="age"><br>
<input type="submit" value="Send">
</form>

<?php
if ($_POST)
{
   echo 'Hello ' . htmlentities($_POST['name']) . ', you are ' . htmlentities($_POST['age']) . ' years old.
}
?>

http://php.net/manual/en/reserved.variables.post.php
jmraker
Turning off register_globals is a good idea (and doesn't limit PHP support) because when submitted form fields create global variables it could be used maliciously to overwrite the default value of any uninitialized global variable.

http://phpsec.org/projects/guide/1.html
cybersa
RealisTECHSolutions wrote:
I have been building this website and the server I have it uploaded to has limited PHP support. Specifically they have register_globals=off.

My question is, Is there a way around the global variables and create a contact form?

I have found a couple of walk throughs online, but i have not had success with it yet. If there is a way to create a contact form without PHP, I would be interested in hearing about that as well.

Thank you for your help on this.


If you want to create Contact form without PHP,You can try online contact form.
Lot of contact forms are available online for free.
Simply you need to implement it inside on your webpages.
Search it on Google.
Marcuzzo
RealisTECHSolutions wrote:
I have been building this website and the server I have it uploaded to has limited PHP support. Specifically they have register_globals=off.

My question is, Is there a way around the global variables and create a contact form?

I have found a couple of walk throughs online, but i have not had success with it yet. If there is a way to create a contact form without PHP, I would be interested in hearing about that as well.

Thank you for your help on this.


the question is why do you even need register_globals? it's deprecated by now: http://php.net/manual/en/security.globals.php


I'm sure you can create a perfectly working contact form without using globals, check $_POST
Related topics
Contact page without outlook
contact form
Need a simple Contact form
For those who need a contact form
I am trying to build a contact form using php and flash
How to make Global Variables with PHP?
contact form with IP feature ?
AJAX and PHP contact form
Contact Form prob
Need a Contact form from HTML/PHP
Global variables in jommla 1.0.x?
Need help to make my Flash contact form functioning!
Easy Contact Form with Instructions
Spam protection for contact form?
Contact form or email address?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.