Current location: Hot Scripts Forums » Programming Languages » PHP » Form submission problems


Form submission problems

Reply
  #1 (permalink)  
Old 05-06-05, 03:46 AM
d*d d*d is offline
Newbie Coder
 
Join Date: May 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Form submission problems

I created files in php which contain html form submission sending variables using POST. These files worked fine on my testing server, but now they have been uploaded to a secure server the form submission does not work - it takes three days for the server host to ok any changes made in the files so I can't tinker with them like I usually do -

Any ideas as to why this would happen would be greatly appreciated
Edit/Delete Message
Reply With Quote
  #2 (permalink)  
Old 05-06-05, 04:14 AM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
get a better web host! i recommend www.influencehost.com or www.lunarpages.com
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Reply With Quote
  #3 (permalink)  
Old 05-06-05, 05:30 AM
d*d d*d is offline
Newbie Coder
 
Join Date: May 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
I am stuck with this host as it is my clients, what I really need are possible reasons to check against, it takes three days for the server to review a php file and make it available making testing near impossible
Reply With Quote
  #4 (permalink)  
Old 05-06-05, 07:42 AM
Acecool's Avatar
Acecool Acecool is offline
Aspiring Coder
 
Join Date: Nov 2003
Posts: 506
Thanks: 0
Thanked 0 Times in 0 Posts
You do not have to work in those conditions unless you agreed on them...

Tell them the script was tested and working properly with PHP version X.X.X with no bugs / problems etc..

Ask them to set up another FTP account so you can test it on their server without having to wait 3 days for each change you want to make.
__________________
Check Acecoolco.com for PHP Tutorials, and other tuts
If you plan on contacting me, please read this: Legal Terms & Conditions
Reply With Quote
  #5 (permalink)  
Old 05-09-05, 05:42 AM
d*d d*d is offline
Newbie Coder
 
Join Date: May 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
I'm assumming that since it's a secure server that register_globals is off, my forms use $_POST[], as I understand it they should still work am I wrong in this assumption???
Reply With Quote
  #6 (permalink)  
Old 05-09-05, 05:51 AM
d*d d*d is offline
Newbie Coder
 
Join Date: May 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
one of the source codings, maybe somebody can spot the problem:
<?php
include ('./includes/header_secure.php');

if (isset($_POST['submit'])) { // Handle the form.

require_once ('./mysql_connect.php'); // Connect to the db.

// Check for a first name.
if (eregi ("^[[:alpha:].' -]{2,15}$", stripslashes(trim($_POST['first_name'])))) {
$fn = escape_data($_POST['first_name']);
} else {
$fn = FALSE;
echo '<p class= "warning">Please enter your first name</p>';
}

// Check for a last name.
if (eregi ("^[[:alpha:].' -]{2,30}$", stripslashes(trim($_POST['last_name'])))) {
$ln = escape_data($_POST['last_name']);
} else {
$ln = FALSE;
echo '<p class= "warning">Please enter your last name</p>';
}

// Check for an email address.
if (eregi ("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$", stripslashes(trim($_POST['email'])))) {
$e = escape_data($_POST['email']);
} else {
$e = FALSE;
echo '<p class= "warning">Please enter a valid email address</p>';
}

// Check for a username.
if (eregi ("^[[:alnum:]_]{4,20}$", stripslashes(trim($_POST['username'])))) {
$u = escape_data($_POST['username']);
} else {
$u = FALSE;
echo '<p class= "warning">Please enter a valid username!</p>';
}

// Check for a password and match against the confirmed password.
if (eregi ("^[[:alnum:]]{4,20}$", stripslashes(trim($_POST['password1'])))) {
if ($_POST['password1'] == $_POST['password2']) {
$p = escape_data($_POST['password1']);
} else {
$p = FALSE;
echo '<p class= "warning">Your password did not match the confirmed password!</p>';
}
} else {
$p = FALSE;
echo '<p class= "warning">Please enter a valid password!</p>';
}
// Check for an std code.
if (empty($_POST['std'])) {
$std = FALSE;
$message .= '<p class= "warning">Please enter your std code</p>';
} else {
//
if (!eregi ("^[[:digit:]]+$", stripslashes(trim($_POST['std'])))) {
$std = FALSE;
$message .= '<p class= "warning">Please enter a valid std code.</p>';
} else {
$std = escape_data($_POST['std']);
}
//

}

// Check for an phone number.
if (empty($_POST['phone'])) {
$pn = FALSE;
$message .= '<p class= "warning">You forgot to enter your phone number</p>';
} else {
//
if (!eregi ("^[[:digit:]]+$", stripslashes(trim($_POST['phone'])))) {
$pn = FALSE;
$message .= '<p class= "warning">Please enter a valid phone number.</p>';
} else {
$pn = escape_data($_POST['phone']);
$pn = $std . $pn;
}
//
}
if ($fn && $ln && $e && $u && $p && $pn && $std) { // If everything's OK.

// Make sure the username is available.
$query = "SELECT customer_id FROM customer WHERE username='$u'";
$result = @mysql_query ($query);

if (mysql_num_rows($result) == 0) { // Available.

// Add the user.
$query = "INSERT INTO customer (username, password, first_name, last_name, email, phone, registration_date) VALUES ('$u', '$p', '$fn', '$ln', '$e', $pn, NOW() )";
$result = @mysql_query ($query); // Run the query.

if ($result) { // If it ran OK.

// Send an email, if desired.
$body = "Thank you '{$_POST['first_name']}' for registering with EA-Integration,\n\nYour username is '{$_POST['username']}'\n
your password is '{$_POST['password1']}'\n

info@xxx.com\n";
mail ($_POST['email'], 'Thank you for registering',$body, 'FROM: xxx.com');

echo "<div id=\"left\"><p class = \"bttnstyle1\">Thank you for registering {$_POST['first_name']}</p>\n
<p class=\"copy\">click <a href=\"checkout.php?name=$u&pass=$p\"> here </a> to return</p></div>";
include ('./includes/footer_secure.php'); // Include the HTML footer.
exit();

} else { // If it did not run OK.
// Send a message to the error log, if desired.
echo '<p class = "warning"> You could not be registered due to a system error. We apologize for any inconvenience.</p>';
}

} else { // The username is not available.
echo '<p class = "warning">That username is already taken.</p>';
}

mysql_close(); // Close the database connection.

} else { // If one of the data tests failed.
echo '<p class = "warning">Please try again.</p>';
}

} // End of the main Submit conditional.
?>
<div id="whole">
<p class="heading">Register</p>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table cellpadding="0" cellspacing="10" width="750">

<tr><td><p class="bttnstyle1">First Name: </p></td><td><input type="text" name="first_name" size="15" maxlength="15" value="<?php if (isset($_POST['first_name'])) echo $_POST['first_name']; ?>" /></td></tr>

<tr><td><p class="bttnstyle1">Last Name: </p></td><td><input type="text" name="last_name" size="30" maxlength="30" value="<?php if (isset($_POST['last_name'])) echo (stripslashes($_POST['last_name'])); ?>" /></td></tr>

<tr><td><p class="bttnstyle1">Email Address: </p></td><td><input type="text" name="email" size="40" maxlength="40" value="<?php if (isset($_POST['email'])) echo $_POST['email']; ?>" /></td></tr>

<tr><td><p class="bttnstyle1">Phone Number: </p></td><td><input type="text" name="std" size="5" maxlength="5" value="<?php if (isset($_POST['std'])) echo $_POST['std']; ?>" /> <input type="text" name="phone" size="10" maxlength="10" value="<?php if (isset($_POST['phone'])) echo $_POST['phone']; ?>" /></td></tr>

<tr><td><p class="bttnstyle1">User Name: </p></td><td><input type="text" name="username" size="10" maxlength="20" value="<?php if (isset($_POST['username'])) echo $_POST['username']; ?>" /> <span class="copy">Use only letters, numbers, and the underscore. Must be between 4 and 20 characters long.</span></td></tr>

<tr><td><p class="bttnstyle1">Password: </p></td><td><input type="password" name="password1" size="20" maxlength="20" /> <span class="copy">Use only letters and numbers. Must be between 4 and 20 characters long.</span></td></tr>

<tr><td><p class="bttnstyle1">Confirm Password: </p></td><td><input type="password" name="password2" size="20" maxlength="20" /></td></tr>
<tr><td colspan="2" width="750"><p align="center"><input type="submit" name="submit" value="Register" /></p></td></tr>
</table>
</form></div><!-- End of Form -->

<?php
include ('./includes/footer_secure.php'); // Include the HTML footer.
?>
Reply With Quote
  #7 (permalink)  
Old 05-09-05, 11:12 AM
eq1987 eq1987 is offline
Wannabe Coder
 
Join Date: Dec 2003
Posts: 216
Thanks: 0
Thanked 0 Times in 0 Posts
To get a clear understanding, could you give more information? What exactly is happening when you do what?

If you submit the page, what happens if you use echo $_POST['textbox1']? Assuming textbox1 is a field and has value.

Is the script running overall, just not retrieving POST variables?


Worthless Note: Is your client getting raped in the butt or what? Apollohosting.com offers superb support along with decent storage/transfer for good prices. So does servint.com for higher end sites.
Reply With Quote
  #8 (permalink)  
Old 05-09-05, 11:31 AM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
that is the most horrible coding i have ever seen!

* pukes *
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Reply With Quote
  #9 (permalink)  
Old 05-09-05, 11:39 AM
eq1987 eq1987 is offline
Wannabe Coder
 
Join Date: Dec 2003
Posts: 216
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by FiRe
that is the most horrible coding i have ever seen!

* pukes *
Rather than just saying it sucks like a jackass, why not explain a little?


You give your employer your resume, which you believe is flawless. He hands it back and says, "Son, you are a F***** retard. GET OUT!".

You wonder - "Why? Why didn't he say why!?"
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form Submission, PHP Coding Problem kibby67 PHP 3 12-02-04 01:13 PM
PHP Form Submission script sixflagsga Script Requests 0 10-10-04 07:26 PM
form submission Mikehive PHP 1 10-03-04 02:27 PM
formmail problem gscraper Perl 12 08-27-04 03:06 AM
Limit the form submission according to time bionicsamir PHP 7 05-09-04 11:10 PM


All times are GMT -5. The time now is 06:43 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.