Need help with PHP

  • Predius
  • Newbie
  • Newbie
  • User avatar
  • Posts: 11

Post 3+ Months Ago

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
  • Managedlinks
  • Proficient
  • Proficient
  • Managedlinks
  • Posts: 294

Post 3+ Months Ago

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
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

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.
  • Sabu
  • Beginner
  • Beginner
  • Sabu
  • Posts: 47

Post 3+ Months Ago

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
  • Posts: 11

Post 3+ Months Ago

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
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

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

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 52 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
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.