Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

Countering POST data re-post by refresh

Links for php scripts

Moderators: macek, egami, gesf

Countering POST data re-post by refresh

Postby anuradha » Sat Feb 04, 2012 1:21 am

I'm working on cearting a GUI for sending SMS in my project, but I'm facing problem. I had provided Javascript and the entire page is created with PHP.
I had also created a database to maintain the SMS which is being sent. Now whenever I'm clicking on "Submit" button, evenif the message and contact number is empty still there is a data being sent to the database.
also on refreshing the page a data is stored in the database.
Please help me.......It's very urgent.
anuradha
New php-forum User
New php-forum User
 
Posts: 10
Joined: Thu Dec 29, 2011 10:25 pm

Re: Countering POST data re-post by refresh

Postby egami » Mon Feb 06, 2012 9:37 am

I'm not about to write this code for you, but I can give you a couple of suggestions..


if ($variable != '') {
do your stuff here..
header("Location: mypage.php");
} else {
$_SESSION['error'] = 'Sorry, something was empty.';
header("Location: error.php");
}
User avatar
egami
php-forum GURU
php-forum GURU
 
Posts: 2197
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Countering POST data re-post by refresh

Postby anuradha » Tue Feb 07, 2012 11:12 pm

egami wrote:I'm not about to write this code for you, but I can give you a couple of suggestions..


if ($variable != '') {
do your stuff here..
header("Location: mypage.php");
} else {
$_SESSION['error'] = 'Sorry, something was empty.';
header("Location: error.php");
}




thank you so much. code did help :)
anuradha
New php-forum User
New php-forum User
 
Posts: 10
Joined: Thu Dec 29, 2011 10:25 pm


Return to PHP Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron