Jump to content


php send info to email from 5 different pages


2 replies to this topic

#1 HEki_

    Young Padawan

  • Members
  • Pip
  • 165 posts

Posted 06 June 2008 - 06:21 AM

Hi,

right now i have 5 pages with items and on every page i have a form. so if you want to say select 3 items on page 1, u have to fill in the form and send the email, than i have to go to page 2, select items and fill in the form again and send an email, ... is there a way to save selected items (like with online stores, where they put selected items into a shoppingbag) and than fillout the form only 1 time ...

how would i go and save the selected items, check them later and when finished fill out the form and sent it to my email?

#2 NGPixel

    Senior Programmer

  • P2L Staff
  • PipPipPipPip
  • 1,410 posts
  • Gender:Male
  • Location:Montreal, Canada
  • Interests:Web Design : Coding : Animation

Posted 06 June 2008 - 08:41 PM

by using Sessions:

Read this and look at the examples using pages:

http://ca.php.net/ma...ssion-start.php

#3 HEki_

    Young Padawan

  • Members
  • Pip
  • 165 posts

Posted 17 June 2008 - 05:06 AM

Dam this thing is realy hard for me ... so i made a simple example:
www.heki.xdimenzija.com/test/stran1.php

here is hte code:
<?php
// stran1.php

session_start();

$_SESSION['stroj1'] = "$stroj1";
$_SESSION['stroj2'] = "$stroj2";

?>

<body>
<table width="400" border="0">
  <tr>
	<td><img src="images/1.jpg" width="200" height="200" /></td>
	<td><img src="images/2.jpg" width="200" height="200" /></td>
  </tr>
  <tr>
	<td><input  type="checkbox"  name="checkbox[]"  value="<? $stroj1 ?>">v košarico</td>
	<td><input  type="checkbox"  name="checkbox[]"  value="<? $stroj2 ?>">v košarico</td>
  </tr>
</table>

<p><a href="stran2.php">link</a></p>
</body>
</html>

<?php
// stran2.php

session_start();

echo 'Welcome to page #2<br />';

echo $_SESSION['stroj1']; // stroj1
echo $_SESSION['stroj2'];   // stroj2

?>

only 2 items ... but i cant get it to work ... if i replace the:
$_SESSION['stroj1'] = "$stroj1";

with

$_SESSION['stroj1'] = "sometxt";

it does display sometxt ... but how do i now connect this together so that only that text gets shows, which was selected on previous page??? i would realy apreciated if someone could gide me in the right direction ...

best regards,
tk





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users