Main Menu
collapse

Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

User Info

Welcome Guest.
Please log in.

Who's Online

  • Dot Guests: 1272
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]


Welcome to SimplePortal.net! You can download SimplePortal from the Downloads Area!

Background Images in Pages??

Started by The Wizard, October 30, 2010, 10:41:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

The Wizard

Hello:

I'm wondering if you can put a background image in a page in the php mode? If so could you please post the entire code to do this? I have try-ed a dozen ways and have not found one that will work.
Note: I want to have diffrent pages with diffrent backrounds.

Any help would be appreciated :(

130860

it depends on what you want to do in your php page, for example, a ximple div  can do that:


<?php
echo '<div style="background-image:url('urlofmyimage.gif');"> ';

//my code


echo '</div>';
?>


http://www.w3schools.com/css/css_background.asp

The Wizard

Quote from: 130860 on October 30, 2010, 08:04:46 PM
it depends on what you want to do in your php page, for example, a ximple div  can do that:


<?php
echo '<div style="background-image:url('urlofmyimage.gif');"> ';

//my code


echo '</div>';
?>


http://www.w3schools.com/css/css_background.asp

I sorry to say that if you take that code and put it in a SP page in the php mode you get this - Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/class116/public_html/testbb/Sources/Subs-Portal.php(1155) : eval()'d code on line 1

Oh and here is the code I used -
Quoteecho '<div style="background-image:url('http://www.classictoysonline.com/testbb/tribe-images/big_backgrounds/lifebig.jpg');"> ';

//my code


echo '</div>';



So what am I doing wrong?
Thanks for the Help


130860

the code I put was just for example and the error was in   ('urlofmyimage.gif')

you have to scape single quotes with \  like this:

(\'urlofmyimage.gif\')


however, this code will not do nothing unless  you give a valid url for your background  and somthing to fill out the div 

The Wizard

To: 130860

Thank you very much for the help the code worked like a dream!