 |

07-23-2004, 01:04 PM
|
|
WebProWorld Pro
|
|
Join Date: Feb 2004
Location: England Baby!
Posts: 222
|
|
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.
|

07-23-2004, 02:49 PM
|
|
WebProWorld Pro
|
|
Join Date: Mar 2004
Location: Pittsburgh, PA, USA
Posts: 114
|
|
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
|

07-23-2004, 03:33 PM
|
 |
WebProWorld Pro
|
|
Join Date: Jul 2003
Location: UK
Posts: 261
|
|
Learn image manipulation using the GD library. It's useful for a number of things and is great fun.
|

07-23-2004, 11:17 PM
|
 |
WebProWorld 1,000+ Club
|
|
Join Date: Aug 2003
Location: Central US
Posts: 1,581
|
|
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.
|

07-23-2004, 11:20 PM
|
|
WebProWorld Member
|
|
Join Date: Jul 2004
Location: ---| here |---
Posts: 85
|
|
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.
|

07-24-2004, 10:47 AM
|
|
WebProWorld Pro
|
|
Join Date: Mar 2004
Location: Pittsburgh, PA, USA
Posts: 114
|
|
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']\"/>"
|

07-26-2004, 06:06 AM
|
|
WebProWorld Pro
|
|
Join Date: Feb 2004
Location: England Baby!
Posts: 222
|
|
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.
|

07-26-2004, 09:39 PM
|
 |
WebProWorld Pro
|
|
Join Date: Jul 2003
Location: UK
Posts: 261
|
|
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.
|

07-27-2004, 01:50 AM
|
 |
WebProWorld Veteran
|
|
Join Date: Apr 2004
Posts: 328
|
|
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.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|