Update my database after submit

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
mpol_ch
User
Posts: 877
Location: Switzerland

Update my database after submit

Post by mpol_ch »

Hello
I have a html page witht code below. The html page is not generated with PHPMAKER. But I want to sent an update message to my database or to my app (phpmaker 10) after the user enter an value into to the field "voucher" and click onto Login.
Then a SQL statment shoul be send to my application and update the datebase like "Update ... WHERE voucher=$voucher"...
I will appriciate any suggestion.

<form method="get" action="$authaction">
<input name="tok" value="$tok" type="hidden" />
<input name="redir" value="$redir" type="hidden" />
<input class="inputbox" name="voucher" size="6" type="text" />&nbsp;
<button class="button" type="SUBMIT">Login</button>
</form>

thanks
mpol_ch


mobhar
User
Posts: 11737

Post by mobhar »

  1. Try to change this code:
    <input class="inputbox" name="voucher" size="6" type="text" />&nbsp;

become:
<input class="inputbox" name="voucher" size="6" type="text" value="<?php echo @$_GET["voucher"] ?>" />&nbsp;

  1. You should then catch the value of "voucher" in the same file, for example:

<?php
if (isset($GET["voucher"]) && $GET["voucher"] != "") {
echo "Voucher: " . $_GET["voucher"]; // check and make sure the value is valid ...
// your SQL to update the database goes here ...
}
?>

  1. Always refer to the code in the generated "add.php" or "edit.php" file.

mpol_ch
User
Posts: 877
Location: Switzerland

Post by mpol_ch »

Hello mobhar

it doesnot helped. When do the adjustment then I see in the field voucher "<?php echo @$_GET["voucher"] ?>". Is that mean the the page does not support PHP?

The form has <form method="get" action="$authaction">. And the the form is located on a server where I can not have access. Is it then possible to do something here?

thanks

mpol_ch


mobhar
User
Posts: 11737

Post by mobhar »

mpol_ch wrote:
Is that mean the the page does not support PHP?

I think so. Make sure your code has been put in .php file, and not .html file.


mpol_ch
User
Posts: 877
Location: Switzerland

Post by mpol_ch »

hello mobhar

thanks. Yes, I am afraid, that to store php file on the server of page (cloud) is not allowed. Do you see solution here? Is there a work arround?

thanks
mpol_ch


mobhar
User
Posts: 11737

Post by mobhar »

The only solution is you have to put the code in the .php file.


scs
User
Posts: 694

Post by scs »

What I suggest is,

  1. generate a blankpage.php

  2. Write a custom function or script in any language you like.

  3. Copy or Rename the blankpage.php to The_filename_you_like.php

  4. Open The_filename_you_like.php and look for this string '<!-- Put your custom html here -->'.

  5. Replace or Call the function stated in step 2. and enclose with <?php func_or_script ?>

Hope this help.


Post Reply