Jump to content

Drop down form not working?


davie

Recommended Posts

Hello, i appologise if i am posting in the wrong place, i have done research on the net for a couple of weeks before attempting to ask the question and i have not been able to find an answer to help me.

 

I have brought an auction script all of which seems to work exept for one drop down box

 

i have searched the net for starters to create my own drop down box however have completely confused myself.

 

i will now post the parts of the code i can find relating to the drop down box to see if any one can find the problem.

 

This is found on a page called ship_detail.tpl

?>
<? if(!empty($err_serivce))
{
?>
<tr><td></td>
<td><a href="ship_detail.php#txtservice">Services</a> - <?= $err_service; ?></td></tr>
<?
}
...
<font size=2>Choose Postage Service</font></b>
<?
}
?>
         
<select name="chkservice">
<option value="">Select</option>
<?
$ser_sql="select * from postage_service";
$ser_res=mysql_query($ser_sql);
while($service_row=mysql_fetch_array($ser_res))
{
if($service_row['service_name']==$service)
{
?>
<option value="<?= $service_row['service_name'] ?>" selected><?= ucwords($service_row['service_name']) ?></option>
<?
}
else
{
?>
<option value="<?= $service_row['service_name'] ?>"><?= ucwords($service_row['service_name'])?></option>
<?
}
}
?>
</select></td></tr>
<tr>

 

 

 

and this is found on the page called detail.tpl

<? if($row['post_service']=='royal-mail-1st-class') { ?><td><img src="images/royal-mail-1st-class.jpg" /></td>
         <? } if($row['post_service']=='royal-mail-2nd-class') { ?><td><img src="images/royal-mail-2nd-class.jpg" /></td>
         <? } if($row['post_service']=='DPD') { ?><td><img src="images/DPD.jpg" /></td>
         <? } if($row['post_service']=='DHL') { ?><td><img src="images/DHL.jpg" /></td>
         <? } if($row['post_service']=='Fedex') { ?><td><img src="images/fedex.jpg" /></td>
         <? } if($row['post_service']=='parcel-force-24') { ?><td><img src="images/parcel-force-24.jpg" /></td>
         <? } if($row['post_service']=='parcel-force-48') { ?><td><img src="images/case-collection.jpg" /></td>
         <? } if($row['post_service']=='case-collection') { ?><td><img src="images/parcel-force-48.jpg" /></td>
         <? } if($row['post_service']=='other-postages') { ?><td><img src="images/other-postages.jpg" /></td>
         <? } if($row['post_service']=='pickup-only') { ?><td><img src="images/pickup-only.jpg" /></td><? }?>
        <td> <? echo $row['post_service']; ?></td></tr>

 

the database file and values are as follows

Field - Type - Collation - Null - Extra Action

service_id - bigint(20) No auto_increment

service_name - varchar(50) latin1_general_ci No

 

all the shipping types are listed in side the database followed by a value number

(for example Royal mail (Value:1)

 

 

Thanks for everyones help in advance

Link to comment
Share on other sites

Does anything in that code work? I ask this because the short open <? and 'quick echo' <?= tag syntax is disabled by default on recent versions of php. If the rest of the code is working, please explain what you mean by "not working".

Link to comment
Share on other sites

Does anything in that code work? I ask this because the short open <? and 'quick echo' <?= tag syntax is disabled by default on recent versions of php. If the rest of the code is working, please explain what you mean by "not working".

 

sorry i am completely knackered and head isn't with it, i'll try and make it more clear.

 

Yes the whole script seems to be fully working, everything seems to work as it should, apart from this one thing.

 

i'll try and explain.

 

i am selling an item,

title (Works)

sub title (works)

description(works)

image upload(works)

payment type (also a drop down and fully works)

postage service THIS IS THE PART I AM HAVING PROBLEMS WITH

 

 

i go through and input the required detailsi then choose what type postage service i want, for example royal mail, dhl, fedex ect

 

 

i then press a submit button which links me to a preview page

 

then on to the final auction page one that everyone would see.

 

everything is diplayed and is correct on this page exept the chosen postage service.

 

i can see this is meant to be displayed as an image however the image does not display what so ever, it is almost as if it is not saving the chosen postage service, or if it is saving the chosen postage service it is not allowing me to fetch the chosen postage service.

 

if this makes any sense at all.

 

Thank you for your help and im sorry it wasn't to clear.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.