Forums

PHP

This topic is locked

Checkbox value being passed but not received

Posted 31 Mar 2007 13:18:11
1
has voted
31 Mar 2007 13:18:11 Jim Paulino posted:
In the first part of the php code all is correct (somewhat).
The second page is not processing all the values.

1st page

<form action="link_acco_add2.php" method="post">
<table width="400" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="400" class="bgwhi" align="left" valign="top" colspan="3">

<div class="heatexblu">Add New Link!</div>

<div class="contex">
<? echo $page_content; ?>
</div>
<font face="Arial" size="2"><b>Note: </b>Please include <b>www </b>in
the URL box<br>
Please verify that all Payment Processor links start with <b></b> </font>
<br />

</td>
<tr>
<td width="350" height="25" class="bgwhi" align="right" valign="middle"><div class="bolblu">Title:</div></td>
<td width="10" height="25" class="bgwhi"></td>
<td width="290" height="25" class="bgwhi" align="left" valign="middle"><input type="text" maxlength="20" name="newtitle" maxlength="50" class="inpbox" /></td>
</tr>
<tr>
<td width="350" height="25" class="bgwhi" align="right" valign="middle"><div class="bolblu">URL:</div></td>
<td width="10" height="25" class="bgwhi"></td>
<td width="290" height="25" class="bgwhi" align="left" valign="middle"><input type="text" name="url" class="inpbox" /></td>
</tr>
<tr>
<td width="350" height="25" class="bgwhi" align="right" valign="middle"><div class="bolblu">Funding:</div></td>
<td width="10" height="25" class="bgwhi"></td>
<td width="290" height="25" class="bgwhi" align="left" valign="middle">
<select name="funding">
<option name="1" value="1">$1.00</option>
<option name="5" value="5">$5.00</option>
<option name="10" value="10">$10.00</option>
<option name="15" value="15">$15.00</option>
<option name="20" value="20">$20.00</option>
<option name="25" value="25">$25.00</option>
<option name="30" value="30">$30.00</option>
<option name="35" value="35">$35.00</option>
<option name="40" value="40">$40.00</option>
<option name="45" value="45">$45.00</option>
<option name="50" value="50">$50.00</option>
<option name="55" value="55">$55.00</option>
<option name="60" value="60">$60.00</option>
<option name="65" value="65">$65.00</option>
<option name="70" value="70">$70.00</option>
<option name="75" value="75">$75.00</option>
<option name="80" value="80">$80.00</option>
<option name="85" value="85">$85.00</option>
<option name="90" value="90">$90.00</option>
<option name="95" value="95">$95.00</option>
<option name="100" value="100">$100.00</option>
</select>
</td>
</tr>
<tr>
<td width="350" height="25" class="bgwhi" align="right" valign="middle"><div class="bolblu">Pay Per Click:</div></td>
<td width="10" height="25" class="bgwhi"></td>
<td width="290" height="25" class="bgwhi" align="left" valign="middle">
<select name="newperclick">
<option name="0.02" value="0.02">$0.02</option>
<option name="0.03" value="0.03">$0.03</option>
<option name="0.04" value="0.04">$0.04</option>
<option name="0.05" value="0.05">$0.05</option>
<option name="0.06" value="0.06">$0.06</option>
<option name="0.07" value="0.07">$0.07</option>
<option name="0.08" value="0.08">$0.08</option>
<option name="0.09" value="0.09">$0.09</option>
<option name="0.10" value="0.10">$0.10</option>
<option name="0.11" value="0.11">$0.11</option>
<option name="0.12" value="0.12">$0.12</option>
</select>
</td>
</tr>
<tr>
<td width="350" height="25" class="bgwhi" align="right" valign="middle"><div class="bolblu">Minimum View Time:</div></td>
<td width="10" height="25" class="bgwhi"></td>
<td width="290" height="25" class="bgwhi" align="left" valign="middle">
<select name="newtime">
<option name="5" value="5">5 seconds</option>
<option name="10" value="10">10 seconds</option>
<option name="15" value="15">15 seconds</option>
<option name="20" value="20">20 seconds</option>
<option name="25" value="25">25 seconds</option>
<option name="30" value="30">30 seconds</option>
<option name="35" value="35">35 seconds</option>
<option name="40" value="40">40 seconds</option>
<option name="45" value="45">45 seconds</option>
<option name="50" value="50">50 seconds</option>
<option name="55" value="55">55 seconds</option>
</select>
</td>
</tr>
<tr>
<td width="350" height="35" class="bgwhi" align="right" valign="middle"><div class="bolblu">Special:</div></td>
<td width="10" height="35" class="bgwhi"></td>
&lt;td width="290" height="35" class="bgwhi" align="left" valign="middle"&gt;&lt;div class="contex"&gt;&lt;input type="checkbox" name="bold" value="1" /&gt; Bold ($&lt;?=$g_bold;?&gt<img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>&lt;/div&gt;&lt;div class="contex"&gt;&lt;input type="checkbox" name="italic" value="1" /&gt; Italicized ($&lt;?=$g_italic;?&gt<img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="350" height="35" class="bgwhi"&gt;&lt;/td&gt;
&lt;td width="10" height="35" class="bgwhi"&gt;&lt;/td&gt;
&lt;td width="290" height="35" class="bgwhi" align="left" valign="middle"&gt;&lt;input type="submit" value="Next Step" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;



2nd PAGE

&lt;?
include('includes/data_conn.php');
session_start();
if ($HTTP_SESSION_VARS[aduser])
{
if ($newtitle && $url && $funding && $newperclick && $newtime)
{

if ($_POST["bold"]) $final_price = $g_bold + $funding;
{
$final_price = $g_bold + $funding;
}
if ($italic)
{
$final_price = $g_italic + $funding;
}
$check_url = substr($url, 0, 7);
if ($check_url == '')
{
$url = strrev($url);
$url = substr($url, 0, -7);
$url = strrev($url);
}
if ($insert_link = mysql_query("INSERT INTO links (linkid, addr, username, title, total, perclick, hits, bold, italic, timer, status, owe) VALUES (NULL, '$url', '$aduser', '$newtitle', '$funding', '$newperclick', '0', '$bold', '$italic', '$newtime', 'inactive', '$final_price')")
{

$newl_id = mysql_insert_id();
if ($HTTP_SESSION_VARS[newl_id])
{
session_unregister("newl_id";
}
session_register("newl_id";
session_register("final_price";
include('includes/header.php');
echo "&lt;div class=\"contex\"&gt;&lt;div class=\"heatexblu\"&gt;You're Not Done Yet!&lt;/div&gt;Your link will not be added until you pay a fee of $$final_price via PayPal.&lt;br /&gt;&lt;br /&gt;You may do so by clicking the button below.&lt;br /&gt;&lt;br /&gt;";
}
else
{
include('includes/header.php');
echo "&lt;div class=\"contex\"&gt;&lt;div class=\"heatexblu\"&gt;Error!&lt;/div&gt;An unknown error occurred while processing your request.&lt;br /&gt;&lt;br /&gt;If the problem persists, please &lt;a href=\"contact.php\" class=\"acon\"&gt;contact&lt;/a&gt; the system administrator.&lt;br /&gt;&lt;br /&gt;";
}
}
else
{
include('includes/header.php');
echo "&lt;div class=\"contex\"&gt;&lt;div class=\"heatexblu\"&gt;Error!&lt;/div&gt;You did not provide a value for all of the fields.&lt;br /&gt;&lt;br /&gt;Please click back in your browser and try again.&lt;br /&gt;&lt;br /&gt;";
}
}
?&gt;

Reply to this topic