spiceworld Posted January 14, 2007 Share Posted January 14, 2007 HiI need to add the code below to a PHP file but can't get it right.[code] <b>Your Cart Contains</b><br> <a class="infoBoxContents" href=<?=tep_href_link('shopping_cart.php')?>><?=$cart->count_contents()?> items<br> Sub Total: <?= $currencies->format($cart->show_total())?>[/code]I have been trying to add it to the code below[code]<td class="infoBoxContents"><?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_CART_TOTAL); new infoBoxHeading($info_box_contents, false, true, tep_href_link(FILENAME_CART_TOTAL)); <--CODE NEEDS TO GO HERE--> new infoBox($info_box_contents); ?> </td>[/code]Any help would be great, even if your not sure as it might get my brain in gear ;DCheers Richard Quote Link to comment https://forums.phpfreaks.com/topic/34073-code-help/ Share on other sites More sharing options...
Nameless12 Posted January 14, 2007 Share Posted January 14, 2007 Your post is vague and impossible to understand as you did not make your question clear to me it just looks like incomplete code with html comments that would cause an error. So I am going to assume you wanted people to help you put code there??There is not enough code there for people to fill in the blanks. If you have problems writing code paste posts asking for help on the errors but dont ask people to fill in the blanks Quote Link to comment https://forums.phpfreaks.com/topic/34073-code-help/#findComment-160215 Share on other sites More sharing options...
spiceworld Posted January 14, 2007 Author Share Posted January 14, 2007 HiSorry that the post is vague (i didn't realise) as i don't understand PHP etc and thought this was the place to ask. Had i realised that i should learn PHP before posting, i would have :-\But as with the code above it works fine, but dosn't work when i put the following: <--code start--> new infoBox($info_box_contents); ?> <--code end-->after the html statement.I'm sorry if this isn't complete code (but it's all i've got) and if so just tell me and i'll go away and try and figure it out myself or try another help forum.Cheers Richard Quote Link to comment https://forums.phpfreaks.com/topic/34073-code-help/#findComment-160411 Share on other sites More sharing options...
Barand Posted January 14, 2007 Share Posted January 14, 2007 Recommended readinghttp://jesirose.com/2007/01/06/how-to-ask-questions-the-smart-way/#more-14 Quote Link to comment https://forums.phpfreaks.com/topic/34073-code-help/#findComment-160436 Share on other sites More sharing options...
spiceworld Posted January 14, 2007 Author Share Posted January 14, 2007 Yes understood - BUT seeing that i'm not a php coder, i didn't know it was incomplete, and being told it's incomplete code with no further explanation is a bit of a piss take of an answer. Surely it would be better to stay quiet.BUT having looked at the code and TRIED a few things i now realise that the following code might be required:[code] $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => ' SOME CODE HERE? '); [/code]So it would now look like this:[code]<td class="infoBoxContents"><?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_CART_TOTAL); new infoBoxHeading($info_box_contents, false, true, tep_href_link(FILENAME_CART_TOTAL)); $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => ' THE CODE NEEDS TO GO HERE? '); new infoBox($info_box_contents); ?> </td>[/code]And "THE CODE NEEDS TO GO HERE?" is as below:[code] Your Cart Contains <a class="infoBoxContents" href=<?=tep_href_link('shopping_cart.php')?>><?=$cart->count_contents()?> items Sub Total: <?= $currencies->format($cart->show_total())?>[/code]Hope that is now MORE complete, but as i stated before, i'm not a php coder so it might not be.Cheers Richard Quote Link to comment https://forums.phpfreaks.com/topic/34073-code-help/#findComment-160447 Share on other sites More sharing options...
trq Posted January 14, 2007 Share Posted January 14, 2007 Your question is still very vague. What is it your actually having problems with? Quote Link to comment https://forums.phpfreaks.com/topic/34073-code-help/#findComment-160450 Share on other sites More sharing options...
spiceworld Posted January 14, 2007 Author Share Posted January 14, 2007 All i want to do is put the code stated within a php box, but without the code at the end it doesn't put the box border around it all.Cheers Richard Quote Link to comment https://forums.phpfreaks.com/topic/34073-code-help/#findComment-160452 Share on other sites More sharing options...
trq Posted January 14, 2007 Share Posted January 14, 2007 Sorry, youv'e lost me all together. PHP doesn't have box's, in fact it doesn't ouput anything but html. Maybe you need to look into either learning php or hiring someone to customize whatever it is your trying to customize. Quote Link to comment https://forums.phpfreaks.com/topic/34073-code-help/#findComment-160456 Share on other sites More sharing options...
spiceworld Posted January 14, 2007 Author Share Posted January 14, 2007 So can you tell me why the code is incomplete to you. And if so why is it incomplete?All the code above does is create a box with a border around it, don't ask me how i don't know, but i do know that the code required is complete on the above page to complete the task. This code:[code]<td class="infoBoxContents"><?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_CART_TOTAL); new infoBoxHeading($info_box_contents, false, true, tep_href_link(FILENAME_CART_TOTAL)); $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => '<a class="infoBoxContents">items<br></a>'); new infoBox($info_box_contents); ?> </td>[/code]is creating the box (Heading "Cart Total") in the right hand column at: http://www.southcoastpetsupplies.co.uk/catalog/index.phpSo i just need to input the code in that.Cheers Richard Quote Link to comment https://forums.phpfreaks.com/topic/34073-code-help/#findComment-160462 Share on other sites More sharing options...
trq Posted January 14, 2007 Share Posted January 14, 2007 Its not necessarily your code that is incomplete but your question. You are failing to discribe what it is your trying to do.Read the link in my signiture and come back when you can form a simple question. Quote Link to comment https://forums.phpfreaks.com/topic/34073-code-help/#findComment-160466 Share on other sites More sharing options...
redbullmarky Posted January 14, 2007 Share Posted January 14, 2007 in your first post, you provide two bits of code. the bit that draws the box, and the bit of code that you say should go in it. what exactly happens when you actually put the said code into the other code?[b]edit[/b]: PS, if you wrap your code that you post here in [ code] [ /code] tags (without the spaces), it'll make things a little easier for us to read. cheers Quote Link to comment https://forums.phpfreaks.com/topic/34073-code-help/#findComment-160467 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.