Jump to content

Need help with HTML page


Troydesante

Recommended Posts

Hello,

 

I'm busy with making a website about computers. I also want to add some sort of page were you can set your own computer together.This needs to be like this:

 

Case:

(dropdown with all the cases)

Power Supply

(dropdown with all the PUS's)

 

 

and so on for all the parts. Now, that's easy. Now what should happen:

You select all the parts you want and then you can press next. This brings you to a new page were all the selected item wil stand like:

 

Case:

Corsair Obsidian 750D

Power Supply:

Corsair CX430

 

 

So somehow it to "read" what the user selected in the first page, it needs to "remember" it when I go to the next page and "write" it down again.

In the second page I need a checkbox with I agree with the terms and conditions.

They can only press next if the checkbox is checked, and when they press next, it should email all the items the user selected to a emailadress...

 

 

I'm totally stuck on this... I tried everything that I know so far. But I'm totally stuck...

Is there someone who can help me? Or give me info how to do that (Like with .php instead of .html)

 

 

 

Thanks in advanced!

Kind regards,

Troy

Link to comment
Share on other sites

You can either do that with Javascript with just one page, or use PHP and multiple pages. Explanations on how to handle forms in Javascript and PHP is in the W3schools.com tutorials.

Link to comment
Share on other sites

Hello,

 

I tried Javascript in the past 2 days, but how do I make a dropdown for the page and that Javascript "remembers" them?

 

I need something like this:

 

 

 

<select id="Case"> <option value="1">Corsair Obsidian 450D</option> <option value="2">Corsair Obsidian 750D</option> <option value="3">Corsair Obsidian 900D</option></select>

 

<select id="CPU"> <option value="1">Intel Core I3</option> <option value="2">Intel Core I5</option> <option value="3">Intel Core I7</option></select>

 

 

<button type="button">Next</button>

 

 

 

 

When you press the button, you should go to the "next page" were there is something like this:

 

 

 

<h1> You choose this parts: </h1>

<ul> <li>Case: (the case you choose)</li> (But I need it to be like id="Case" and value="1" so like: Case1) <li>CPU: (The cpu you choose)</li> (But I need it to be like id="CPU" and value="1" so like: CPU1)</ul>

 

and then after the checked, they can press a send button, which send a email to me with all the parts that they choose...I have the email sender allready, but I have no idea how to do the Javascript and how to link it so the email sender knows which items I picked...

Link to comment
Share on other sites

You have to use server language such as php to read form input values from previous page. basic example

 

page 1 can be just a html page because its not reading data sent from server

        <form action="page2.php" method="post">            <select id="Case" name="case">                <option value="1">Corsair Obsidian 450D</option>                <option value="2">Corsair Obsidian 750D</option>                <option value="3">Corsair Obsidian 900D</option>            </select>            <select id="CPU" name="cpu">                <option value="1">Intel Core I3</option>                <option value="2">Intel Core I5</option>                <option value="3">Intel Core I7</option>            </select>            <input type="submit" value="Next">        </form>

page2.php must be php

<?php$cpu = "";$case = "";if (isset($_POST['cpu'])) {    $cpu = $_POST['cpu'];}if (isset($_POST['case'])) {    $case = $_POST['case'];}?><!DOCTYPE html><!--To change this license header, choose License Headers in Project Properties.To change this template file, choose Tools | Templatesand open the template in the editor.--><html>    <head>        <meta charset="UTF-8">        <title></title>    </head>    <body>        <h1> You choose this parts: </h1>        <ul>            <li>Case: <?php echo $case; ?></li>            <li>CPU: <?php echo $cpu; ?></li>        </ul>        <form action="page3.php" method="post">            <input type="hidden" name="case" value="<?php echo $case; ?>" >            <input type="hidden" name="cpu" value="<?php echo $cpu; ?>" >            <input type="submit" value="Next">        </form>    </body></html>

page3.php will be the email php page and basically work as previous page2 to retrieve values from hidden inputs to send with email.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...