Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within PHP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
PHP
redirecting to unknown link after clicking on button
Suyog Choure
Greenhorn
Posts: 1
I like...
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
When i am clicking on Edit User button user information is getting updated but at the same time page is redirecting to link which is not present.
<? php if(isset($_POST['edituser'])){ $euser = " UPDATE users SET uname='".$_POST['rudname']."', upass='".$_POST['rudpass']."', uemail='".$_POST['rudemail']."'"; if(isset($_POST['membership'])){ $time = $_POST['timem']; $euser.= " ,acc_type=1 , p_start=NOW(), p_end = (NOW() + INTERVAL {$time} MONTH)"; } $euser.= " WHERE uid=".$_GET['uid']; $eres = mysql_query($euser,$con);if($eres){ $_SESSION['crudusererr'] = "User ".$_POST['rudname']." Updated !"; header("Location: /".$_GET['uid']); }else {die("Editing user <b>".$_POST['rudname']."</b> fail ! <br \>".mysql_error());} ?> <div style="float: left;" > <input style="width:180px; height:40px;font-size: 15px;color: #00cc66;" type="submit" name="edituser" value="Edit User <?php echo $ouname; ?>" /> </div><!-- edit -->
Nick Charles
Ranch Hand
Posts: 71
I like...
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You need to provide a <form> element to identify where to send the data upon clicking the button. Example:
<form action="xxx.php" method="post"> <input ... type="submit" name="edituser" .../> </form>
If you were a tree, what sort of tree would you be? This tiny ad is a poop beast.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
PHP Basics
Javascript and PHP
\r\n db saving and echo issue
problem in updating data
MD5
More...