View Full Version : Oy, please help. New to PHP...

04-06-2011, 12:29 AM
Hi there,

I'm pretty new to PHP coding and am having the worst time figuring this out.

I am trying to place a Hotels.com search box in a single post - not on every page or in the sidebar or anything like that. Just need to get the box on one page of my site.

I thought it was going to be a simple case of HTML code that is placed in the HTML section of a blog entry, but the code is actually fairly long and it's stumping me a bit.

I know, or at least I think most of the code needs to go into the single.PHP file under the line that reads:
<?php the_content(); ?>

I'm hoping this is correct anyways, but I'm not sure which part I actually place in the HTML section of a post entry.

Would someone please mind taking a look at the code (i will attach it) and let me know if A] I'm correct in thinking to adapt the single.PHP file, and B] what part of the code goes there and what part goes in the actual post itself.

I would GREATLY appreciate it.


04-06-2011, 12:34 AM
I think you've uploaded the wrong file; there is no PHP code in here.
About 90% of this is CSS, you should pull that out into a .css document of its own just to simplify this (makes it look a little cleaner ;)).
Also, in the future please select a title that better explains the problem.

04-06-2011, 12:37 AM
Then I am completely wrong and it's not PHP but instead CSS code? That means it would not go into the single PHP file but instead to the CSS style sheet??

Can you tell me, would the 90% that you mention go into the style sheet and the other 10% go into the actual HTML section of my WP post?

Thanks much


04-06-2011, 12:40 AM
Thats correct. The CSS would be anything between <style type="text/css">...</style> tags. All remaining tags would be html.
I don't see a the_content, so I don't know what it is you are trying to do. CSS's purpose is for pure rendering control, nothing more. You cannot process any input without either directing to an external script, or writing one of your own (JS has limited capabilities; it can be used to connect remotely to another web form, but cannot process on its own).

04-06-2011, 12:45 AM
So, if I put the code between the CSS tags into the style sheet (at the bottom okay), and the rest - the HTML code - into the body of my actual post this could work??

I'm simply trying to get a Hotels.com search box to appear on one page of my site, and the affiliate manager over there is a bit slow in getting back to me, so I'm trying to find someone who will take pity on me and direct me a bit.

Your help has been and continues to be appreciated.