Trying but failing - PHP if statement

Discuss all aspects of programming here.

Moderator: The Mod Squad

Postby olly » Tue Mar 20, 2007 2:05 pm

Looks like something to do with your brackets, like the javascript has its own brackets and its confusing the php or something. Or the quotation marks.

I'm no PHP expert though unfortunately, just hacked a bit here and there.
olly
Green Belt
Green Belt
 
Posts: 222
Joined: Thu Jun 27, 2002 8:11 pm

Postby Toby B. » Sun Mar 25, 2007 8:15 pm

Sorry for the late replay olly, I appreciate the help. Til such time as I learn more php and/or have the extra time to toy around with it til it works I have managed a sloppy "work around". The result from this work around (i.e. putting the javascript as an include) it dumps the code into the page body versus the page head, looks ugly as hell for my tastes, but it works.
Toby B.
Lead Mobo-fu Master
Lead Mobo-fu Master
 
Posts: 14277
Joined: Sun Dec 16, 2001 1:01 am
Location: Maine

Postby olly » Mon Mar 26, 2007 12:06 pm

You could try using external .js files and just call a function and return a value from them.

http://www.w3schools.com/js/js_functions.asp
olly
Green Belt
Green Belt
 
Posts: 222
Joined: Thu Jun 27, 2002 8:11 pm

Postby Toby B. » Mon Mar 26, 2007 12:48 pm

olly wrote:You could try using external .js files and just call a function and return a value from them.

http://www.w3schools.com/js/js_functions.asp
will take a peek
thanks
Toby B.
Lead Mobo-fu Master
Lead Mobo-fu Master
 
Posts: 14277
Joined: Sun Dec 16, 2001 1:01 am
Location: Maine

Postby rilorilo » Fri May 11, 2007 4:37 pm

Change:
Code: Select all
<?php if ($page_name == Support & Drivers) {


To:
Code: Select all
<?php if ($page_name == "Support & Drivers") {
rilorilo
Initiate
Initiate
 
Posts: 23
Joined: Fri May 11, 2007 12:57 pm
Location: Denmark

Previous

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests

cron