davie Posted May 3, 2011 Share Posted May 3, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/235391-drop-down-form-not-working/ Share on other sites More sharing options...
Pikachu2000 Posted May 3, 2011 Share Posted May 3, 2011 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". Quote Link to comment https://forums.phpfreaks.com/topic/235391-drop-down-form-not-working/#findComment-1209715 Share on other sites More sharing options...
davie Posted May 3, 2011 Author Share Posted May 3, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/235391-drop-down-form-not-working/#findComment-1209716 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.