Jump to content

Recommended Posts

Hello Everyone!

I am developing a website that I use PHP and I am new into it.

I have a form that the browser will enter the details into it. I wanted it after that to store all the details into a database. I was reading some books for PHP and I already figured out how to do that.

based on the book that I read. It says I should seperate the PHP and HTML into different files and this is what I done but the problem that I am facing of that that when I click on submit button it goes to the php and shows empty screen.

all the html code for the form is into a file .html and then I used the action= to the php file.

do anyone knows how can I solve this problem

I would really approciate that.

Regards,
firedrop
Link to comment
https://forums.phpfreaks.com/topic/5291-php-and-html/
Share on other sites

As stated, either the book is wrong, you you misunderstood what the book told you...

You would create the PHP file that handles your form, then after it is finished, you may add your HTML to the same page to either display a result, or redirect them somewhere else, or whatever...

One of a millions things you can do...please ignore any syntax errors...
[code]
<?php
// Process your form
?>
<HTML>
<body>
<h1> Your form has been submitted. Please click the button below to continue...</h1>
<form name = "DONE" action="nextpage.html">
<input type="button" >
</form>
</body>
</HTML>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/5291-php-and-html/#findComment-18805
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.