22, November 2008

What is this code and this operator? - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: What is this code and this operator?
« previous next »
Pages: 1 [2] Print

Author Topic: What is this code and this operator?  (Read 1407 times)
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8249
42481 credits
Members referred : 3



« Reply #20 on: Sep 01, 2006, 10:55:39 AM »

Quote
I would use the code multiple times in the same page, but not with the same function call, will that still keep the same image from appearing?

I am not sure what you mean by that. If you keep this funtion, then the only thing needed to not display the same image is the existence of this line:

$showedPics = array();

in the beginning of the script. This is the array that the funtion globalizes to keep the images that have been displayed.

Quote
I will be using it with the script for my directory. Can this be easily saved as a separate file and then called from the template file?

Of course. Just save the file, and then include it from every page you want to use it.

Quote
I opted not to take the php class at the local community college, with the directory, I'm now sorry I didn't. I could probably learn it from a book, but the structure of a class makes it easier.

Don't worry you are in the webdigity university now Smiley

BTW I learned php from the web. Never had the chance to have a teacher on this language, but still I know a lot Wink

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Bill Gates is my home boy
*****
Gender: Female
Posts: 634
3957 credits
Members referred : 2



« Reply #21 on: Sep 03, 2006, 05:57:33 PM »

Uhm, OK, I thought I understood what I was doing with this.

With my original file all I did was put this statement where I wanted an image:
Quote
<img src="http://www.mysite.com/zigs/random3.php Visit through proxy" alt="crafty picture">

I've been trying to figure out how to include the new file and make the function call and failing miserably.

The page where I use this is made up of 3 template files: header, index and footer.

Where header has the beginning of the html code and the info to display the top of the page, index has the main content of the page, and footer has the footer and end of the html file.

Where do I put the include statement? How do I make the include statement? I've tried several variations and all of them have either displayed the header only with an error message or done nothing.

I guess I need another lesson with this.  Embarrassed

www.yourmessageconsultant.com Visit through proxy, providing online content and printed marketing materials.
www.helpforwebbeginners.com Visit through proxy, Tutorials and how to's for new  webmasters.
www.CraftyTips.com Visit through proxy, a unique Arts & Crafts Directory
www.nocans.com Visit through proxy - Pet Food Recipe Site
www.petsiteguides.com Visit through proxy - A New Pet Directory

Last blog : Hot Glue Failures and Other Turkeys
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8249
42481 credits
Members referred : 3



« Reply #22 on: Sep 03, 2006, 06:00:29 PM »

Well you need to include the random image code file, from the page that you want to display the images.

Then from this page you will call the function like this :

Code:
<?php
echo RandomImage(3);

And it will automatically produce the <img> tags to display the random images.

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Bill Gates is my home boy
*****
Gender: Female
Posts: 634
3957 credits
Members referred : 2



« Reply #23 on: Sep 03, 2006, 06:11:55 PM »

How do I include the random image file?

www.yourmessageconsultant.com Visit through proxy, providing online content and printed marketing materials.
www.helpforwebbeginners.com Visit through proxy, Tutorials and how to's for new  webmasters.
www.CraftyTips.com Visit through proxy, a unique Arts & Crafts Directory
www.nocans.com Visit through proxy - Pet Food Recipe Site
www.petsiteguides.com Visit through proxy - A New Pet Directory

Last blog : Hot Glue Failures and Other Turkeys
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8249
42481 credits
Members referred : 3



« Reply #24 on: Sep 03, 2006, 06:16:01 PM »

Actually you don't even have to include anything.

Just copy and paste the code of the snippet in the page that you want to display the images.

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=3880
Tags : google html photoshop webdigity snippets Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: 1 [2] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: What is this code and this operator?
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Nov 22, 2008, 07:59:55 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 37.734
Total Topics: 7.649
Total Members: 4.394
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: rdgoetz

30 Guests, 4 Users online :

15 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.