Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-23-2004, 01:04 PM
WebProWorld Pro
 

Join Date: Feb 2004
Location: England Baby!
Posts: 222
icb01co2 RepRank 0
Default What else should i learn?

Hi all,
Ive been using .php for a little while now and i'm coming to grasps with most of the basics but now ive found that for what ive been doing i use the same basics. Im just wondering if theres anything else i should learn within the .php language to stop myself from doing something in a long winded way that could be done much easier. Heres what i know so far: -

- How to use include files effectively.
- mySQL database access/manipulation.
- Function calls and a little about objects (should
I learn more or are functions sufficient)
- Form and url data passing/retrieval
- Image uploading
- String manipulation i.e. explode() etc

Im thinking i know enough for the moment and i want to spend time learning a little JavaScript for some fancy effects but if theres anything obvious that i should know please let me know.

Oh actually i would like to know how to get the HTTP information that is passed to the browser when a web page is loaded and use it as a .php variable, along with the methods that can be applied to it. Isnt is fconnect() method or something?

Thanks, Chris.
Reply With Quote
  #2 (permalink)  
Old 07-23-2004, 02:49 PM
WebProWorld Pro
 

Join Date: Mar 2004
Location: Pittsburgh, PA, USA
Posts: 114
ChrisRC RepRank 0
Default

Quote:
Im thinking i know enough for the moment and i want to spend time learning a little JavaScript for some fancy effects
It's hard to offer much advice without knowing what you plan to do with this knowlege. The above statment makes me wonder if you plan to use it for good or for evil:) Javascript does have it's place, but I've found server side scripting *much* more useful.

I would suggest that anyone learning PHP should, at some point, spend an hour or more reading the manual. That Function Reference is extremely useful and even if you don't fully understand some of it now, it may pop into your head "hey didn't I see that somewhere..." when you actually do need it.

Quote:
how to get the HTTP information that is passed to the browser when a web page is loaded and use it as a .php variable
I think you want to check out the predefined $_SERVER array.

Chris Collins
crcdesign.net
Reply With Quote
  #3 (permalink)  
Old 07-23-2004, 03:33 PM
splinter's Avatar
WebProWorld Pro
 

Join Date: Jul 2003
Location: UK
Posts: 261
splinter RepRank 0
Default

Learn image manipulation using the GD library. It's useful for a number of things and is great fun.
Reply With Quote
  #4 (permalink)  
Old 07-23-2004, 11:17 PM
ronniethedodger's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Central US
Posts: 1,581
ronniethedodger RepRank 0
Default

Quote:
Originally Posted by ChrisRC
Quote:
Im thinking i know enough for the moment and i want to spend time learning a little JavaScript for some fancy effects
It's hard to offer much advice without knowing what you plan to do with this knowlege. The above statment makes me wonder if you plan to use it for good or for evil:) Javascript does have it's place, but I've found server side scripting *much* more useful.

Quote:
how to get the HTTP information that is passed to the browser when a web page is loaded and use it as a .php variable
I think you want to check out the predefined $_SERVER array.
A real world example of some good uses of JavaScript where php will not get the job done is an example of those free tracking scripts you would place on your pages. The script is processed by a remote server and some of the $_SERVER variables will get lost in the call to that remote script.

Code:
<script>
<!--
  stats = "referrer=" + escape(window.document.referrer);
  stats += "&agent=" + escape(navigator.userAgent);
  document.write('');
//-->
</script>
You will need to pass JavaScripted variables for $referrer, $agent, and $siteid to the remote php script. This is the only data that cannot be retrieved through the PHP script.

BTW, this script will run on non-php pages as well! Another good use of JavaScript.
Reply With Quote
  #5 (permalink)  
Old 07-23-2004, 11:20 PM
WebProWorld Member
 

Join Date: Jul 2004
Location: ---| here |---
Posts: 85
vivekar RepRank 0
Default

How about building PHP apps using Object Oriented approach, added with a nice database abstraction layer.

http://php.weblogs.com/ADODB
http://www.xoops.org

Have fun. Happy learning.
Reply With Quote
  #6 (permalink)  
Old 07-24-2004, 10:47 AM
WebProWorld Pro
 

Join Date: Mar 2004
Location: Pittsburgh, PA, USA
Posts: 114
ChrisRC RepRank 0
Default

Quote:
A real world example of some good uses of JavaScript where php will not get the job done is an example of those free tracking scripts you would place on your pages. The script is processed by a remote server and some of the $_SERVER variables will get lost in the call to that remote script.

Code:
<script>
<!--
stats = "referrer=" + escape(window.document.referrer);
stats += "&agent=" + escape(navigator.userAgent);
document.write('');
//-->
</script>


You will need to pass JavaScripted variables for $referrer, $agent, and $siteid to the remote php script. This is the only data that cannot be retrieved through the PHP script.
I don't want to drift this general question thread too much, but since this does relate to his second question, I'm curious - I'm not sure what kind of tracking script you're referring to, but what about them prevents you from doing this:

echo "<img border=\"0\" height=\"1\" width=\"1\" src=\"http://www.yoursite.com/folder/button.php?siteid=$idnumber&referrer=$_SERVER['HTTP_REFERER']&agent=$_SERVER['HTTP_USER_AGENT']\"/>"
Reply With Quote
  #7 (permalink)  
Old 07-26-2004, 06:06 AM
WebProWorld Pro
 

Join Date: Feb 2004
Location: England Baby!
Posts: 222
icb01co2 RepRank 0
Default Thanks all.

Hi all,
Thanks for the comments ive look at the predefined $_SERVER array, im pretty sure thats what i was looking for to get the HTTP information that is passed to the browser, so thanks for that.

Also ive had a little look around at image manipulation using the GD library. It looks very interesting but i cant find anything in terms of a good tutorial, mostly just people showing off what they have done using GD lib. Any ideas?

I also think ChrisRC's point about looking through the manual is a good one, most of the time i dont spend time learning any of the functions untill i need to. But i think quickly skimming through to get a grasp of what can be done without actually learning every function call isnt a bad idea.
Reply With Quote
  #8 (permalink)  
Old 07-26-2004, 09:39 PM
splinter's Avatar
WebProWorld Pro
 

Join Date: Jul 2003
Location: UK
Posts: 261
splinter RepRank 0
Default Re: Thanks all.

Quote:
Originally Posted by icb01co2
Also ive had a little look around at image manipulation using the GD library. It looks very interesting but i cant find anything in terms of a good tutorial, mostly just people showing off what they have done using GD lib. Any ideas?
Check out http://www.phpfreaks.com

They have some good tutorials.
Reply With Quote
  #9 (permalink)  
Old 07-27-2004, 01:50 AM
Easywebdev's Avatar
WebProWorld Veteran
 

Join Date: Apr 2004
Posts: 328
Easywebdev RepRank 1
Default

As regards the GD library, I have only ever used it to resize an uploaded image, create a thumbnail and put a black border around each.

It sound a little complicated but when you get used to gd then its only a matter of 10/12 lines of code.

I have'nt tried generating images on the fly based on user input but as any designer will tell you, you only investigate it when you need to do it.

From the tutorials I've read on it what I detailed above is only the tip of the iceberg in comparison to what it can actually do.

Familiarity with the GD library can only enhance a webmasters arsenal of tools.
__________________
"I have not failed. I have found 10,000 ways that don't work" - Thomas Edison.
"The secret to creativity is knowing how to hide your sources" - Albert Einstein.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0