Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-13-2012, 10:16 AM   PM User | #1
Razzy
New Coder

 
Join Date: Jun 2012
Posts: 41
Thanks: 14
Thanked 1 Time in 1 Post
Razzy is an unknown quantity at this point
show resulting output on another page and send url link to email

hey people, i am trying to create a simple form, and would like the user to input some details on a form, when the user clicks the submit button, it should load another page showing the input details.

also is there any way of sending the url link of the webpage to an email address?

the form is shown below:

Code:
<fieldset id="personal" > 
        <table align="center">
        <tr>
        <td style="font-weight:bold"> 1. First Name: </td> <td> <input type="text" name="first_name" /></td>
        </tr>
        
        <tr>   
        <br/>   
        <td style="font-weight:bold"> 2. Last Name: </td>  <td>   <input type="text" name="last_name_"  /></td>
        </tr>
			
        <tr>	 
        <td style="font-weight:bold"> 3. Firstline Address: </td>  <td><input type="text" name="address"/> </td>
        </tr>
        <tr>	 
        <td style="font-weight:bold"> 4. Post Code: </td>  <td><input type="text" name="postcode"/> </td>
        </tr>
        <tr>	 
        <td style="font-weight:bold"> 5. Telephone No: </td>  <td><input type="text" name="tel_no"/> </td>
        </tr>
        <tr>
        <td style="font-weight:bold"> 6. Email Address: </td>  <td><input type="text" name="email"/> </td>
        </tr>
        </table>
        <br/>

		<table align="center">
		<tr>
        <td style="font-weight:bold">
		7. Are you a Company or an individual? &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        </td>
        </tr>
         </tr>
           </table>
           
            <table align="center" width="220px">
        <tr>
   	       <td> <input type="radio" name="group1" value="Company" />
          
           Company</td>
        </tr>
        <tr>
          
          
           <td><input type="radio" name="group1" value="Individual" />
   	      								Individual</td>
                                        </tr>
                                        </table>
          
               <br/>    	   
                   	      
   	     <table align="center">
         <tr>
         <td style="font-weight:bold">
         7. Delivery or Pick-up from shop? &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
         </td>
         </tr>
         </table>
         
         <table align="center" width="220px">
         <tr>
         <td align="left"><input type="radio" name="group2" value="Delivery"/>
         
		 Delivery</td>
          
		</tr>
        <tr>
        <td>
			  <input type="radio" name="group2" value="Pick-up"/>
              
			Pick-up</td>
            </tr>
            </table>
		
			</td>
            </tr>
            </table>			
	    </fieldset>
would really appreciate it if someone could help

thank you
Razzy is offline   Reply With Quote
Old 07-13-2012, 01:37 PM   PM User | #2
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,045
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
So as it stands now, you only have the form you show in post #1?

Do you have a line that looks like ...
<form action="blahblah" method="post">

There needs to be a form action. That will be a PHP script
that processes the form and does whatever you want with the form data.

If you don't have a form action, and are not sure what I'm talking about,
you might want to use Google: PHP contact form script tutorial

=============

But back to the original question ... what URL link are you talking about?

Quote:
url link of the webpage
I'm not sure what that means.
mlseim is offline   Reply With Quote
Old 07-13-2012, 02:49 PM   PM User | #3
Razzy
New Coder

 
Join Date: Jun 2012
Posts: 41
Thanks: 14
Thanked 1 Time in 1 Post
Razzy is an unknown quantity at this point
sorry i forgot to include the form tags....the coding below is for testing purposes but very similar to the one i posted first:

Code:
<form method="post" action="test2.php">>

	<table>
	<tr>
	<td>
	&bull; lamb burger<input type="hidden" id="valueB0" value="2.99"/>
	<br/>
	Quantity:<input type="text" id="qtyB0" name="qtyB0" size="2" value=""/>	
	
   
    &bull; chicken burger<input type="hidden" id="valueB1" value="4.20"/>
	<br/>
	Quantity:<input type="text" id="qtyB1" name="qtyB1" size="2" value=""/>	
	
   
    &bull; beef burger<input type="hidden" id="valueB2" value="4.20"/>
	<br/>
	Quantity:<input type="text" id="qtyB2" name="qtyB2" size="2" value=""/>	
	<br/>
	<input type="button" onclick="calculateTwo();" value="Total"/>
	<br/>
	<span id="resultTwo"></span><br /><br />
	</td>
	</tr>
	</table>
	
</form>
so basically i wanted the inputted values to be outputted in a tabular format in test2.php, and at the same time to send an email consisting the url of test2.php......so that both, (1) the user will see the results in a tabular format as soon as they click the submit button, and (2) and the company will also see the results via the url sent to the email address.

i hope u understand it this time

thank you very much for replying to the post
Razzy is offline   Reply With Quote
Old 07-14-2012, 01:16 AM   PM User | #4
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,045
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
Does the user enter a URL?

I don't see how you aquire a URL.

Or ... are you telling me that the form shows up an many different websites?

Maybe your definition of a "URL" is not the same as mine?
mlseim is offline   Reply With Quote
Old 07-14-2012, 01:59 AM   PM User | #5
jdswebservice
Regular Coder

 
jdswebservice's Avatar
 
Join Date: Aug 2010
Location: Moon Township, PA
Posts: 107
Thanks: 0
Thanked 5 Times in 5 Posts
jdswebservice can only hope to improve
If you are trying to have the form submit, THEN have the data entered displayed on page 2 PLUS emailed to an email address, thats pretty easy. If this is what you want let me know and i'll post code for ya!

J-
__________________
Jonathan R.
Email: jonathan@logicaldevelopment.net
Skype, Aim, & Jabber: logicaldevelopment
Website: http://logicaldevelopment.net/

NOTE: When contacting me please have the following things ready:

Thread ID (This can be found in the URL of your thread)
Budget of Project
Methods of contacting you/your organization
Preferred method if many methods are provided

Any website information that you PM, Email, IM, or otherwise is strictly confidential and will not be disseminated, distributed, or copied in any way, shape or form.
jdswebservice is offline   Reply With Quote
Old 07-14-2012, 05:49 PM   PM User | #6
Razzy
New Coder

 
Join Date: Jun 2012
Posts: 41
Thanks: 14
Thanked 1 Time in 1 Post
Razzy is an unknown quantity at this point
lol sorry mlseim, basically i wanted the link to the second page sent to an email address so that the company can view the submitted data too ....

and yes jdswebservice, thats exactly what i want, however instead of the entered data displayed on the email address, i jus wanted the link of the SECOND page on the email address, so that member of staff within the company to which the website belongs to can view the entered data too by clicking the lnk

thank you very much
Razzy is offline   Reply With Quote
Old 07-14-2012, 06:37 PM   PM User | #7
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,045
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
So, we can just post a plain contact page email script, but there's a lot more
that needs to be addressed ... which makes it hard for us to post a script.

What if they enter something wrong, or don't enter a particular box?
The form will need to have "validation", and tell them what's wrong either
on the 2nd page, or stay on the form and tell them.

What if a spammer decides to submit your form 1000 times using a spamming script?
The form will need some sort of captcha code or "is the user a human"?
Can ANYONE submit the form without any idea of who they are?

What if the user types it all out and submits it successfully, and then, oops, I put
the wrong address in there! Oh no ... how do I fix that? The user has to do the
form again and resubmit. But now, there are two emails sent. What if the recipient
only sees the first email (with the wrong address)?

What if the person submits the form and decides to add more items to their order?
They send another form? ... but the recipient gets two emails and may or may not
figure out if the person is adding to the previous order, or creating a new order.
This will be really confusing to the recipient?

Will the person who sent the form get some sort of confirmation showing the info
that they sent, and that the recipient has seen it? How will the person who sent
the form know that it was recieved?

See what I mean?
You have a lot more things to consider and decisions to make.
This just isn't a "send a form" script.

=========

Maybe each user needs to create a free account (register online).
Then, after confirming their email, they can log-in and fill-out any
orders that they wish. There are NO emails sent.
The recipient is the person (admin or owner) that accesses a webpage
showing ALL pending orders from anyone who has submitted an order.

Any changes to an order by the customer or client is updated
immediately in the database ... the owner sees that right away.
No more need to enter name and email ... because the user has logged-in.
That information has already been entered when they registered.



.

Last edited by mlseim; 07-14-2012 at 06:53 PM..
mlseim is offline   Reply With Quote
Old 07-14-2012, 06:52 PM   PM User | #8
Razzy
New Coder

 
Join Date: Jun 2012
Posts: 41
Thanks: 14
Thanked 1 Time in 1 Post
Razzy is an unknown quantity at this point
hey mlseim, yes this will all be done, i have only just started it, all i am just worried about at this point in time is if its possible to send the weblink of the SECOND page which will contain the filled in data, to an email address
Razzy is offline   Reply With Quote
Old 07-14-2012, 08:34 PM   PM User | #9
jdswebservice
Regular Coder

 
jdswebservice's Avatar
 
Join Date: Aug 2010
Location: Moon Township, PA
Posts: 107
Thanks: 0
Thanked 5 Times in 5 Posts
jdswebservice can only hope to improve
Well, you COULD use the get method in your form(s), however this will be VERY unsecure. My suggestion is to do this. create the form, have it submit to page.2php. page2.php will then post that form to a database, and send a link to the email address provided with the ID of the entry in the database. then you create page3.php?id=x to read, view, and display the information to the people you want.

so page2.php emails the link in the form of,

http://website.com/page3.php?id=x

that'll then be the simple way of doing it, and most secure in my opinion.
__________________
Jonathan R.
Email: jonathan@logicaldevelopment.net
Skype, Aim, & Jabber: logicaldevelopment
Website: http://logicaldevelopment.net/

NOTE: When contacting me please have the following things ready:

Thread ID (This can be found in the URL of your thread)
Budget of Project
Methods of contacting you/your organization
Preferred method if many methods are provided

Any website information that you PM, Email, IM, or otherwise is strictly confidential and will not be disseminated, distributed, or copied in any way, shape or form.
jdswebservice is offline   Reply With Quote
Old 07-14-2012, 08:40 PM   PM User | #10
Len Whistler
Senior Coder

 
Len Whistler's Avatar
 
Join Date: Jul 2002
Location: Vancouver, BC Canada
Posts: 1,323
Thanks: 26
Thanked 100 Times in 100 Posts
Len Whistler is on a distinguished road
Quote:
Originally Posted by Razzy View Post
hey mlseim, yes this will all be done, i have only just started it, all i am just worried about at this point in time is if its possible to send the weblink of the SECOND page which will contain the filled in data, to an email address
I would change the name of test2.php to something more descriptive. For the info to display on test2.php you need use the GET method to query the database. So the URL looks something like test2.php?client=27865. 27865 is the row ID that contains all the client info.
  • Do you have the database setup?
  • I recommend you study the php GET method and how it gets info from databases.
__________________
Leonard Whistler
Len Whistler is offline   Reply With Quote
Old 07-14-2012, 09:23 PM   PM User | #11
Razzy
New Coder

 
Join Date: Jun 2012
Posts: 41
Thanks: 14
Thanked 1 Time in 1 Post
Razzy is an unknown quantity at this point
hey guys, no there is no database on this, basically i am creating an order form within the website of a meatshop, so basically a customer makes an order (they do not need to register), which involves inputting data on textboxes etc, and then it displays the results on another page, but i wanted some form of link of the other page on an email add....im not sure whether it is possible without having to create a database for it?
Razzy is offline   Reply With Quote
Old 07-14-2012, 09:31 PM   PM User | #12
Len Whistler
Senior Coder

 
Len Whistler's Avatar
 
Join Date: Jul 2002
Location: Vancouver, BC Canada
Posts: 1,323
Thanks: 26
Thanked 100 Times in 100 Posts
Len Whistler is on a distinguished road
Quote:
Originally Posted by Razzy View Post
hey guys, no there is no database on this, basically i am creating an order form within the website of a meatshop, so basically a customer makes an order (they do not need to register), which involves inputting data on textboxes etc, and then it displays the results on another page, but i wanted some form of link of the other page on an email add....im not sure whether it is possible without having to create a database for it?
You need some sort of database to store and retrieve the info, and I recommend MySQL, I don't think you can do what you want without a database. MySQL is very easy top learn.
__________________
Leonard Whistler
Len Whistler is offline   Reply With Quote
Old 07-14-2012, 09:51 PM   PM User | #13
stevenmw
Regular Coder

 
stevenmw's Avatar
 
Join Date: Jun 2007
Location: OK
Posts: 446
Thanks: 26
Thanked 30 Times in 30 Posts
stevenmw is an unknown quantity at this point
Razzy, may I ask if there is there a specific reason you're wanting to have a page with the users' submitted info on it?

Quote:
Originally Posted by jdswebservice View Post
If you are trying to have the form submit, THEN have the data entered displayed on page 2 PLUS emailed to an email address, thats pretty easy. If this is what you want let me know and i'll post code for ya!

J-
I agree that this is a very easy method, and wouldn't even require a DB.

But if there is a specific reason you're needing a page complete with a url then the other posts are spot on. You need a DB in order to assign an id to each post in order to give you a unique url for each submission.
stevenmw is offline   Reply With Quote
Old 07-15-2012, 06:33 AM   PM User | #14
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,045
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
You are thinking that when a form is submitted to "test2.php" the script will
display the form data on the user's browser and then send an email to the business
with a link back to that page with the form data. So when the form data is displayed
on the user's browser, that is a "webpage", that can be linked back to from an email.

Is that what you think happens?

==============

If it is, you're not seeing it correctly.

When the form is filled out and they click submit, the form variables are
sent to the script called "test2.php". That script can send the form values
to any email and then display "Thank You for your order". You can send the
data to the business email AND the user's email (as a confirmation). There
is no "webpage" created, and there is no link back to any webpage.
There is no webpage period.

We're saying that the form variables should be written into a database and their
are no emails at all. The business continually checks the database for new orders.
The users can also check the database to see the status of their order(s).
mlseim is offline   Reply With Quote
Old 07-15-2012, 07:10 PM   PM User | #15
Razzy
New Coder

 
Join Date: Jun 2012
Posts: 41
Thanks: 14
Thanked 1 Time in 1 Post
Razzy is an unknown quantity at this point
hey stevenmw, when the user inputs the data, the second page shows shows the inputted data in a tabular format, the reason why i want a second page is for the user to see what he/she has inputted. and the link sent to the email is for the company to view the orders.

so for instance if the url for the second page is: www.blahblah.com/test2.php

then that url should be sent to the email.

just like how form inputs are sent to email addresses with the use of php, im wondering if its possible to send that url to email without the database? if not then i gues im gna have to create a database
Razzy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:33 AM.


Advertisement
Log in to turn off these ads.