Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Programming Help > PHP Programming Help

PHP Programming Help Post any question relating to PHP Programming here and hopefully someone can help.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2008-01-03, 08:03 PM
Junior Member
 
Join Date: Jan 2008
Posts: 2
metalhead3 is on a distinguished road
Default Help!!!!!!

i am lost. i have a page that has a form that sends to a gateway. i have a an amount pre defined in an input field and then i have a switch include where the user can add a golfer registration to their page and i want the cost of the added golfer to be added to the x_Amount in the input field

here is my code for the first page

<form action="../sim.php" method="post" name="contact" id="contact">

<p>


</p>
Name:<br />
<input name="Name" id="" size="50" type="text">
<br />



Company:<br />

<input name="company" id="" size="50" type="text">

<br />


Address:<br />

<input name="address" id="" size="50" type="text">

<br />
Phone: <br />

<input name="phone" id="" size="12" type="text">

<br>

<br />
<br />

Would you like to register any golfers for only $125 a piece.

<a href="?content=oneplayer">1</a>
<a href="?content=twoplayer">2</a>
<a href="?content=threeplayer">3</a>
<a href="?content=fourplayer">4</a>



<br />
<br />
<br />

<?php


$content=$_GET['content'];
if (empty($content)) { $content='none'; }



switch ($content) {
case "none":
include ('blank.php');
break;
case "oneplayer":
include ('onep.php');
break;
case "twoplayer":
include ('twop.php');
break;
case "threeplayer":
include ('threep.php');
break;
case "fourplayer":
include ('fourp.php');
break;






}


?>






<input name="Submit" value="Submit" type="submit">


-----------------------------------------------------

and here is the second



<?php




$x_Amount == x_Amount += 125.00;

?>


<p>
<input name="ff" id="ff" type="text" value="50">
<input name="dd" id="dd" type="text" value="50">




</p>
Name:<br />
<input name="Name" id="" size="50" type="text">
<br />



Company:<br />

<input name="company" id="" size="50" type="text">

<br />


Address:<br />

<input name="address" id="" size="50" type="text">

<br />
Phone: <br />

<input name="phone" id="" size="12" type="text">

<br />

<br />
<br />




..... please help if you can

thanks

dr. z
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 2008-01-06, 12:30 AM
Xnuiem's Avatar
Senior Member
 
Join Date: May 2004
Location: DFW, Texas
Posts: 1,104
Xnuiem will become famous soon enough
Send a message via Yahoo to Xnuiem
Default

Was there a question in there somewhere?

Other than the lack of a question, there is an obvious error:

$x_Amount == x_Amount += 125.00;

I assume should be:

$x_Amount += 125;
__________________
I rarely give code examples.
No, I have never used IIS or Windows of any kind as a web server. Get a real OS!
Please don't PM me, I won't respond.
Reply With Quote
  #3 (permalink)  
Old 2008-01-07, 03:18 PM
Junior Member
 
Join Date: Jan 2008
Posts: 2
metalhead3 is on a distinguished road
Default

i appologize for the erratic method of forming my question. let me start over.

i have a page with an input that has a value of 50.00 and an id/name of x_amount. then on another page, that is going to be included to the static document, i would like to add to the variable x_amount (which is set to 50.00) 125.00.

In the end i will have four of these documents with different amounts and whenever they are included i want the value of x_amount to change.

if this still does not make sense here is slim'd down version of my code.

page 1
--------------------------------------------------------------
<form action="../sim.php" method="post" name="contact" id="contact">

<p>






<input name="x_Amount" id="x_Amount" size="50" type="hidden">






</p>
Name:<br />
<input name="Name" id="" size="50" type="text">
<br />



Company:<br />

<input name="company" id="" size="50" type="text">

<br />


Address:<br />

<input name="address" id="" size="50" type="text">

<br />
Phone: <br />

<input name="phone" id="" size="12" type="text">

<br>

<br />
<br />

Would you like to register any golfers for only $125 a piece.

<a href="?content=oneplayer">1</a>
<a href="?content=twoplayer">2</a>
<a href="?content=threeplayer">3</a>
<a href="?content=fourplayer">4</a>



<br />
<br />
<br />

<?php


$content=$_GET['content'];
if (empty($content)) { $content='none'; }



switch ($content) {
case "none":
include ('blank.php');
break;
case "oneplayer":
include ('onep.php');
break;
case "twoplayer":
include ('twop.php');
break;
case "threeplayer":
include ('threep.php');
break;
case "fourplayer":
include ('fourp.php');
break;






}


?>






<input name="Submit" value="Submit" type="submit">



</form>

page 2
-------------------------------------------------------------------

<?


$xamount = $_POST['x_Amount'];
$second = $_POST['second'];



$xamount += 125;

?>






<input type="submit" value="Calculate values"/>
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.0 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.0 (a popular PHP IDE) and NuCoder 1.4 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:58 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.