Search found 9 matches

by adpd
Wed Jun 15, 2005 9:44 am
Forum: PHP - Code
Topic: PHP or Regular Expression to match word, and echo it
Replies: 1
Views: 123

PHP or Regular Expression to match word, and echo it

I am trying to find a way of writing in PHP the following: if $variable is equal to, or begins with "xyz", echo xyz. The variable is defined as: &lt;? $variable = &quote;xyz&quote;; ?&gt; Some typical examples may be: <? $variable = "Home"; ?> <? $variable = "...
by adpd
Wed Jun 15, 2005 4:18 am
Forum: PHP - Code
Topic: Insert dynamic H1 tag in web page
Replies: 14
Views: 2198

Maybe it is too early in the morning! I get a parse error on line 2 with that code (the long one, not the 2-liner). It may be helpful if I give you all the code - you can then copy and paste it and see if you are getting what I get. The web page is as follows: <!DOCTYPE html PUBLIC &quote;-//W3C...
by adpd
Wed Jun 15, 2005 3:50 am
Forum: PHP - Code
Topic: Insert dynamic H1 tag in web page
Replies: 14
Views: 2198

This may be a silly question, but how do I tie that code back to my $thisPage variable?
by adpd
Wed Jun 15, 2005 3:36 am
Forum: PHP - Code
Topic: Insert dynamic H1 tag in web page
Replies: 14
Views: 2198

Thanks for that Malcolm. However, first I should clarify that I am not using a database to generate the site. I have a static website with some dynamic functions - using PHP to do the dynamic bits. I specify at the beginning of each page what it is, relative to the information architecture using: <?...
by adpd
Wed Jun 15, 2005 2:46 am
Forum: PHP - Code
Topic: Insert dynamic H1 tag in web page
Replies: 14
Views: 2198

I am still struggling with this...

Anybody got any suggestions (apart from to give up!)

Thanks.
by adpd
Tue Jun 14, 2005 10:16 am
Forum: PHP - Code
Topic: Insert dynamic H1 tag in web page
Replies: 14
Views: 2198

Thanks Malcolm. How would I go about constructing this into a larger array that would encompass all top level navigation? For example, if my top level is: "Services", "News", "About Us", "Contact US". The array should then display a top level name in H1 tags, ...
by adpd
Tue Jun 14, 2005 5:47 am
Forum: PHP - Code
Topic: Insert dynamic H1 tag in web page
Replies: 14
Views: 2198

Many thanks. I am trying to implement this code, but am getting an error on line 4: Warning: Wrong datatype for second argument in call to in_array in (web_server_path) /sec_nav_h1.inc.php on line 4 Any ideas what this might be. I am a complete noob to PHP (and programming), so apologies if I am ask...
by adpd
Tue Jun 14, 2005 5:22 am
Forum: PHP - Code
Topic: Insert dynamic H1 tag in web page
Replies: 14
Views: 2198

Thanks for the reply. However, I am not sure this answers the question. I want to know that if the page isn't "Services", but begins with the word "Services", still make $thisPage "Services". For example, take IBM - they offer Services to the IT Sector. $thisPage might ...
by adpd
Tue Jun 14, 2005 5:12 am
Forum: PHP - Code
Topic: Insert dynamic H1 tag in web page
Replies: 14
Views: 2198

Insert dynamic H1 tag in web page

Hi, I am trying to use a simple PHP script to insert a H1 title on a HTML web page. I am determining the variable ($thisPage) in a script in the HTML web page: <?php $thisPage="Services"; ?> The include would look like this: <?php if ($thisPage=="Services") echo "Services&qu...