Need help with PHP

  • Predius
  • Newbie
  • Newbie
  • User avatar
  • Joined: May 19, 2004
  • Posts: 11
  • Status: Offline

Post May 19th, 2004, 7:46 pm

First of all, since this my first post, Hello everyone.

Now, onto business, anyone here knows how do the Webcomics use the index.php?strip=[any number] for using just the index template to post their comics? anyone who would like to help change my html to php and do anything on mysql if needed, i would really thank.

Predius
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post May 19th, 2004, 7:46 pm

  • Managedlinks
  • Proficient
  • Proficient
  • No Avatar
  • Joined: Mar 31, 2004
  • Posts: 294
  • Status: Offline

Post May 19th, 2004, 11:43 pm

PHP is a scripting language (think programming language).
You can do anything you want! but I think others will agree this is not the place to get a crash course on "how to program in PHP".

You may want to look for good online references for learning PHP. a good bookstore would also be a great place to visit.

If your having problems with a concept or a piece of code many people here are willing to help out.
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Mar 24, 2004
  • Posts: 1855
  • Loc: Uk
  • Status: Offline

Post May 19th, 2004, 11:50 pm

A good bookstaore will always help, but computing books are so expensive lol. When I first started with PHP I used this tutorial, which covers not a lot but I found it a good intro:

http://www.devshed.com/c/a/PHP/PHP-101- ... Agent-Man/

To actually answer your question, the strip=[number] gets a record from a database, and then the database indicates what text / images etc to display for that particular record.
CSS website design tutorials
  • Sabu
  • Beginner
  • Beginner
  • No Avatar
  • Joined: May 15, 2004
  • Posts: 49
  • Status: Offline

Post May 20th, 2004, 3:49 am

of you could simply skip all that and trial-and-error your way around this:

PHP Code: [ Select ]
 
if (isset($strip)) {
 
 if (file_exists('comics/$strip.jpg')) {
 
  echo "<img src='comics/$strip.jpg'>";
 
 } else {
 
  echo "Strip not found";
 
 }
 
}
 
 
  1.  
  2. if (isset($strip)) {
  3.  
  4.  if (file_exists('comics/$strip.jpg')) {
  5.  
  6.   echo "<img src='comics/$strip.jpg'>";
  7.  
  8.  } else {
  9.  
  10.   echo "Strip not found";
  11.  
  12.  }
  13.  
  14. }
  15.  
  16.  


Of course, that's only one tiny little bit that looks for the actual image file asked for, then includes it if found. I was planning, at some point, to make a whole online comic script first, but i figured I would have to actually make a comic to ever need it.

If there is a demand..
  • Predius
  • Newbie
  • Newbie
  • User avatar
  • Joined: May 19, 2004
  • Posts: 11
  • Status: Offline

Post May 20th, 2004, 5:36 pm

i dont really get it, maybe someone could help me translate an html page to php?

Tnx
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Joined: May 21, 2004
  • Posts: 3229
  • Loc: South Africa
  • Status: Offline

Post May 21st, 2004, 6:37 am

Predius wrote:
i dont really get it, maybe someone could help me translate an html page to php?

Tnx


There is no way to translate an HTML page to PHP besides echoing the HTML page.

HTML is a markup language which means it does nothing more then allow a standard set of tags for presentation od data.

PHP is a scripting language (like ASP) that allows your users to interact with a database (or any other medium provided you have the correct code) through forms or your interfaces. It interacts with the medium you select then produces and string that the browser recognises (according to the headers it receives) and parses.

Basically you use PHP or ASP to write HTML according to data extracted from your data source
Watch me grow

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 112 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.