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
Win a copy of
Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework
this week in the
Java in General
forum!
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
Tim Cooke
paul wheaton
Liutauras Vilda
Ron McLeod
Sheriffs:
Jeanne Boyarsky
Devaka Cooray
Paul Clapham
Saloon Keepers:
Scott Selikoff
Tim Holloway
Piet Souris
Mikalai Zaikin
Frits Walraven
Bartenders:
Stephan van Hulst
Carey Brown
Forum:
PHP
redirecting to unknown link after clicking on button
Suyog Choure
Greenhorn
Posts: 1
I like...
posted 11 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 11 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>
I have always wanted to have a neighbor just like you - Fred Rogers. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
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...