•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 426,182 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,794 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 937 | Replies: 2
![]() |
•
•
Join Date: Oct 2006
Posts: 128
Reputation:
Rep Power: 3
Solved Threads: 1
Hey everyone. I'm trying to write code to update a stat field within my database and I'm having some trouble passing the variables from the form page to the process page. Below is my code. I know it's not correct. I just want a button to say "Upgrade attribute 1" and on click it goes to process.php, figures out what button was clicked and then runs the function addOneStat which adds one to the stat field. In the future I will have many buttons and I was hoping that the process page could tell the difference between what button was clicked. Any suggestions?? Thanks.
//form page
<table>
<tr><td>
<form action="process.php" method="POST">
Update att1: <input type="hidden" name="subupgradestat" value="att1">
<input type="submit" name="att1" value="att1">
</form>
</td></tr>
</table>//process.php
function procUpdateStat()
{
global $session, $database;
if($_POST['att1'])
{
$database->addOneStat($field);
header("Location: index.php?page=levelup&id=$session->userid");
}
}•
•
Join Date: Nov 2006
Location: South Wales
Posts: 159
Reputation:
Rep Power: 2
Solved Threads: 11
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- How do I pass values from a called form to a calling forms variables? (C++)
- Visual C++ error LNK2022: metadata operation failed (80131187) (C++)
- I need to write code for the save and close botton and close button on my form (C#)
- Making a Fullscreen form and hiding the Windows Taskbar (Pascal and Delphi)
- want one more help (HTML and CSS)
- VB and Excel. (Visual Basic 4 / 5 / 6)
- Macros (Visual Basic 4 / 5 / 6)
- Please Help!!! MOD function (ASP)
Other Threads in the PHP Forum
- Previous Thread: mysql injection
- Next Thread: new to PHP and need help


Linear Mode