/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] input type on php

in file.php, there’s some code like this:

[code=php]$save_button1 = “<input type=”submit” name=”knop” value=”save” onClick=”setValues( ‘1’ );” class=”formbutton”>”;

$save_button2 = “<input type=”button” name=”knop” value=”save” onClick=”setValues( ‘1’ );document.location.href=’cmc.php?id=$relation_id&refreshTopMenu=true&type=sales&search='” class=”formbutton”>”;

$template->process( BUDGET_TOP, array(
lock_button => $lock_button,
save_button => $save_button,
hidden_values_money => $hidden_values_money,
.
.
.
[/code]

it will go to the file.tpl
the save_button will go to :

[code=php]
<form method=”post” action=”edit_budget.php” name=”budget_sales” onkeypress=”checkEnter(events)”>

<td class=”grey” align=”left”>
<input type=”hidden” name=”relation_id” value=”{relation_id}”>
{save_button}
.
.
.
<input type=”button” name=”cancel_button” onClick=”document.location=’edit_relation.php?action=view&type={type}'” class=”formbutton” value=[CANCEL]>
{lock_button}
</td>
[/code]

if i use save_button1, it’ll go to action=”edit_budget.php” & it’ll save some value, but if i use save_button2, it’ll go to the other page but it didn’t save any value..

how to make a button that can save some value & go to other page?
i’m confuse on how to make the button works..

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@abou_hmedJun 19.2006 — in the action page you can check the submit button value

if($_REQUEST['submitName']){

do the action that you want;

header('location:page.php');

}
Copy linkTweet thisAlerts:
@cmon1011authorJun 19.2006 — thx

i've just try using header(blabla.php) & it's working (although i don't use the submit button, all i need is the "header(balblalba.php)" thingy", but thx again ?
×

Success!

Help @cmon1011 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...