karlo
Feb 25 2005, 04:13 AM
Another easy to use and to apply PHP tutorial. CODE <?php print $_SERVER['USER_AGENT']; ?> Means to OUTPUT the visitor's browser. CODE <?php print $_SERVER['REMOTE_ADDR']; ?> Means to OUTPUT the visitor's IP address. CODE <?php print $_SERVER['SERVER_NAME']; ?> Means to OUTPUT the current server. CODE <?php print $_SERVER['DOCUMENT_ROOT']; ?> Menas to OUTPUT the current location where the PHP script is located. How to apply: Create a PHP script with any file name. CODE <html> <head> <title>Sample PHP Script</title> </head> <body> <div align="center" style="font-size: 11px; font-family: verdana; color: black;"> Hello! Welcome to website.com!
Your current browser is: <strong><?php print $_SERVER['USER_AGENT']; ?></strong><br> Your IP address is: <strong><?php print $_SERVER['REMOTE_ADDR']; ?></strong><br><br> This script is located at <strong><?php print $_SERVER['DOCUMENT_ROOT']; ?></strong> on <strong><?php print $_SERVER['SERVER_NAME']; ?></strong><br><br> <strong>If you try to hack my site, I'll know who you are!</strong> </div> </body> </html>
There. It's finish. What do you think?
Reply
OpaQue
Feb 27 2005, 08:22 AM
Pretty nice. Also you can simply run this code <? phpinfo(); ?> and get the output regarding the total no. of available envoirnment variables which are available for you to use. Use those values inside $_SERVER['VARIABLE-NAME-HERE'] and impress your clients
Reply
beeseven
Mar 1 2005, 01:54 AM
I like $_SERVER['HTTP_REFERER'] (that's not a typo--there's supposed to be only one R after the second E). Sometimes it's interesting to see, and you could also make a database of the referrers and see what site gives you the most hits.
Reply
Roly
Mar 1 2005, 02:27 AM
Dont use print, use echo. Its' faster. Only use print when you are using the "or" operator. Liek dis <?php fopen($file, 'w+') or print('Could not open file'); ?>
Reply
rejected
Mar 1 2005, 05:21 AM
Thanks, I may use this for my 404 error, just customize it.  I don't know much about php, but I can understand that little bit. lol
Reply
karlo
Mar 2 2005, 02:34 PM
QUOTE(Roly @ Mar 1 2005, 10:27 AM) Dont use print, use echo. Its' faster. Only use print when you are using the "or" operator. Liek dis <?php fopen($file, 'w+') or print('Could not open file'); ?> i think echo and print are the same.
Reply
Similar Topics
Keywords : simple, php, beginners, easy, apply
- The System Doesn't Let Me Apply For Hosting Upgrade [resolved]
(4)
Cash Lagoon
Fast & Easy Money Online! (5) I don't know how many of you have heard of or tried any of the lagoon sites, but they are by far
the best out there. Cashlagoon.com in particular, has tons for totally free offers, many of which
are recurring daily offers, very low required balances for payout (only $2!!) & so far
every payout I have requested has been processed & completed in less than 2 hours! I definitely
recommend this one to anyone needing to make a few quick bucks. http://www.cashlagoon.com Proof
of my first payouts: http://i38.tinypic.com/vdhitd.png ....
Easy Spicy Ranch Dip Recipe
(4) So one day after school I was hungry like a ravenous beast /tongue.gif"
style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> lol. I wanted something
spicy but we didn't have anything. So I just threw some stuff together and this is what I came
up with. It sounds crazy but it is really good. It can be used with crackers and whatnot. Okay
here's what you need. 1 cup of buttermilk ranch dressing 2 drops of extra virgin olive oil 1
tea spoon of powdered garlic 2 table spoons of Red Devil hot sauce 1 table spoon of chilli powder 1
teaspoon of....
Flash Tutorial Simple Motion Tween
Introduction to motion tween (0) A motion tween is a moving object. In this tutorial we will learn how to make a flash with Adobe
Flash CS3 Professional to move graphics around. Follow these steps 1. Open Adobe Flash CS3, click
File New, Selection Action Script 2.0 and click OK (I prefer 2.0 for compatibility) 2. Now you will
see a blank page like, now we will set the canvas size. Click the background or gray area. 3. Click
Size button on the bottom Properties page. Enter the width, as this example will be width 400px,
and height 300px. 4. Click OK 5. Drag a picture from your folder inside the CS3, or ....
Easy Plants For Brown Thumbs
Plants that are more dummy proof than cacti (1) Do you like plants? Enjoy the way they look? The way they bring a little of Nature's pizazz to
your living space? Do you have a green thumb? If you are anything like me then you answered "yes" to
all but that last "?". Plants at Home Depot whimper in fear when I meander near their aisles. Cacti
cry. They know that my love for plants cannot undo my unnaturally Brown Thumb. Brown Thumb? It is
the opposite of a Green Thumb. The Green Thumb magically allows said owner of such talent to be able
to make any plant blossom, bloom, grow lavishly and more all seemingly withou....
Create Dynamic Html/php Pages Using Simple Vb.net Code
Taking your application data, and creating a webpage for others to vie (1) This example will show you how use a string in VB to create PHP code. In order to do this, you need
a string to store your PHP page and a function that I will list at the bottom of the page for you to
put in a module. This code is written in VB.NET Public Sub CreatePage(ByVal HTMLTitle As
String, ByVal HTMLText As String, ByVal HTMLFileName As String) Dim strFile As String '
---------------------- ' -- Prepare String -- ' ---------------------- strFile = "" '
-------------------- ' -- Write Starter -- ' -------------------- strFile = " " ....
A Pre-request Question About 'excessive Use'
Before I apply for a web hosting account, I have a question about the (17) I am nearly ready to apply for my new hosting account here on Trap17. Before I do though, I have a
question. This relates to your 'Excessive Use' policy, and is something that I have been
caught out with on a previous web host, so I really want to make sure that this is right this time
before I apply. QUOTE(OpaQue @ Jan 7 2005 @ 02:14 PM) EXCESSIVE USE Trap17.com
accounts operate on shared resources. Excessive use or abuse of these shared resources by one
customer may have a negative impact on all other customers. Misuse of resources in a manner w....
Cannot Apply For Hosting
(14) Well, since I get the error message "Our records indicate you have already submitted an application.
Please wait for it to be accepted or denied." error...I can't get hosted here. Moving on to a
different host I guess.. /sad.gif" style="vertical-align:middle" emoid=":(" border="0"
alt="sad.gif" />....
Easy Realmedia Producer
Convert AVI to RMVB to save disk space (0) I tried this nice tool to convert some movies to rmvb format and they work great. You can find the
software here: http://www.freewarefiles.com/ Not sure if it supports direct rip of DVD's but
it definitely supports a lot of video format. It can also convert some non-Nokia 770 playable rmvb
files to playable ones. Anyways, enjoy.....
A Simple Preg_replace Help Please.
(2) Hello.. Im looking for some help. I want to use preg_replace function to replace the following type
of code tags. CODE <code lang="php"></code> <code
lang="javascript"></code> <code lang="css"></code>
My question is that, in the above code tags, language (lang) is not always same, how can i use
preg_replace with the above code tags to place them with something. Any help will be very much
appreciated. thanks.....
Make Money Using Chacha
very easy and legit (12) If anyone wants to become a guide at chacha.com; I have up to like 20 invites. give me your name
and email and i'll invite the first 20 people. When I get more invites i'll invite more
people. Here's some news articles about chacha:
http://abcnews.go.com/GMA/TakeControlOfYourLife/ http://news.com.com/2100-1038_3-6109782.html ....
Simple Javascript And Password System
How to protect your pages with password (9) The quickest way to get a password protection system up and running is to use a Prompt box in
JavaScript that has a title like "Enter your Email Address". Only you and the relevant users know
what the password should be, could even be one each, that can be sorted out at the next page then
pass the "input" directly through the url by changing the .href, like
http://www.iSource.net.nz/users/?leTmeIn= The page that then processes this should also check for
the referring page, and three fails from an IP if you like the php (the next page): CODE
<?php // processdo....
Easy Cure For Depression?
(10) The website www.3minutedepressioncure.com claims to hav a quick fix for getting rid of your
depression by regulating your vitamin B intake. Personally I think it's crap because I
could't find any scientific explanation that sounds valid for me. Has anyone heard (or even
tried) this? I also heard that mind-training is probably the best way to get rid of a depression
(so no vitamins), unless there's evidence of some biologic disorder. Does anyone know if
that's true?....
Remembering Your Dreams
An easy trick that really works. (10) So many people forget their dreams in the first few minutes after waking up, but there are some
tricks to keeping then if you would like to try it. It takes some practice, but it really works.
Anyway, it did for me. First of all, at night just before you go to sleep, tell yourself that you
want to remember your dream. Try to think about that as you are drifting off. Then, just as you
start to wake up. Do not open your eyes or move too much. Start immediatly thinking about the
dream you just (hopefully) had. Run it back through you mind, try hard not to let any....
Adsense Earning Is Just Made Easy
(3) Many people have been thinking that just registering with adsense and place the ads on your website
you will earn money.I know many people thinking them will earn lots of money by just having there
ads on.I will give you some advice about adsense. You get your adsense approved them when you put
your ads on your website it is the best the use the 336 x 280 rectangle between your text.Many
people say its the best adsense format to earn money.Don't forget to melt to ads with your
template of your blog or website.Its best.Then after that you make some directory promotion....
Simple Php Login And Registration System
(15) Hello. This is my first web tutorial ever. This is basically a simple register and login script.
Yes, I know it’s a bit rubbish but I’m quite new to PHP/MySQL. Here’s the register form. This can
be any file extension you like. I’d recommend calling it register.html . CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html
xmlns="http://www.w3.org/1999/xhtml"> <head> <meta
http-equiv="Content-Type" content="text/ht....
Very Simple Online Now Script
This is a very simple online now script. (4) Hi all, Its Aldo. anyways, I wont be using the method of pagination, i will just tell you how to
make a basic online now script. When someone logs in, now take into consideration that the name of
the username input is username ( First ,create a table in your database saying online now and add 2
fields to it. id and username CODE id type=integer(INT) , auto increment, length =255
and username = VARCHAR length=the limit a username should be in your site now from there we take
off : CODE <?php //logged.php //authentication script //connection scri....
Registry Easy
GiveAway of 22nd August (6) Registry Easy This is a GREAT tool, which not only fixes just about ALL errors in your
registry, it also comes with a LOAD of other neat utilities to speed up your PC and make it
freshened again. (See pic). Anyone else tried this out? What will you rate it? I give 5/5 -
Simply marvellous ....
Real Paying Site
Easy and quick (10) That site really pays and I have recieved my first payment of 10 dollars. This is really easy not
much of a big minimum payout and if you want you too can make money by just going here and signing
up http://adbux.org If you want please do add me as a referrer as zak92 Thank you.....
I Need Recipes That Are Easy And Very Quick To Make
(25) Hey, I need recipes that are easy to make and fast. I work from home but am flooded with people all
the time so I need to usually take off atleast 1 hour for those jerks /tongue.gif"
style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> as it goes for cooking and
serving and junk. Help if anybody can, I am running out of recipes for my friends and family.
Thanks a lot guys. I dont have the time to watch shows and as most of you can cook I will be happy
about your recipes But I do not want any spamming here. Thanks....
Learn Html Quick And Easy
HTML, javascript, and CSS (15) well eversince i got interested in web desighn i've looked for tutorials but they where not that
helpfull and uderstanderble but there where two web sites that i liked 1. my favorite one was
htmldog it had tutorials on HTML, CSS, and a little bit of javascript. they where very
comprehenseve . and i read through all of them, understoode them, in about less than a week. also
has full references for HTML, and CSS tags. 2.since html dog did not provide realy good javascript
tutorial i looked to w3school for that while it wasnt very understandable too me, maybe it....
Invisionfree Skinning Tutorial * Skill Level: Easy
So you want to skin invisionfree? (7) Welcome, I have made this tutorial because our forums are in desprate need of skinners.. program
im using: gimp (im using this because its free, therefore we hopefully can get more skinners) how
long it takes to make a skin? about 3 hours at best SIZES Maintitle - 750 x 29 px(or bigger)
Titlemedium - 6 x 19 px Darkrow2 - 750 x 20 px Userlinks - 750 x 20 px (depends) Submenu - 750 x 29
px (depends) Caldate - 106 x 21 px lets begin! first off lets go to
http://www.invisionfree.com and register a board! name it wisely for your first skin. but you
can alw....
Playing Flash Movies Without The One-click Activation: Simple Insertion Of Javascript
(4) In the past year or two iternet explorer and other browsers have updated their coding platforms.
The bad thing is that if you have any flash objects at all within your web page you have to hit the
space bar or click on the flash object to activate it. Once you activate it, you then can interact
with the object or the object will then play on the website. I dont like how you have to activate
the flash player first to interact with it. here is the code to prevent that. Believe me people
notice how much better the site is after you do this. put <script type="text/java....
How To Recover Data On A Failed Hard Drive
Using a simple house-hold freezer! (2) The information here is from http://geeksaresexy.blogspot.com/2006/01/f...cover-data.html , and I
take no responsibility for blah blah blah. Oh yeah, and this only works if your hard drive fails
in a certain way, of which I'm not certain, so give it a try and it may or may not work. So
anywho, oh snap!! Your hard drive just failed, and can't be booted off of any
more!! And you just finished typing up your doctorate thesis, which you have been working
on for four years! Take that hard drive out of the computer, put it in a ziplock bag (or....
Simple C File Handling In Action
Small code snipet which covers most of basic file handling and navigat (4) Yesterday I suddenly got a lot of work. The same work we try to push off, yes you are right all
formalities to get the code review incorporated and update all source code files with code review
headers. Imagine if you need to open 300 files one by one and append code review headers at the
end. Since most files are reviewed in groups of 20 to 30 files. We require one header to be placed
in say 20 to 30 files. To simplify I went back to my class assignment days and wrote this small c
utility to open all files passed on command line and open attach code review headers an....
Verifying Email Addresses
Using a simple PHP script (9) This simple script will allow you to run some basic checks to make sure that any email address
entered is actually an email address. There is no guarantee offered that this will stop every single
fake email address, but it'll provide some protection. Now, the code! First we need to get
the email address to verify. Here, I get it using POST from an HTML form. CODE <?php //Load
email address from web form $email = $_POST['email']; Now, we move on
to our first check. Does the text that has been entered look like it could b....
A Pretty Good Easy Way To Make Some Money
runescape./ (21) well if you have like runescape accounts or so and stuff. you should make like new accounts and then
make them members (5 USD a month) auto the acc and forget about it. move money to a legit character.
ya u lose the 5 bucks per acc but you can make about 150 bucks for each char a month. well if you
thieve guards for a whole month about 1 million= 5 USD a day.....
How To: Change Your Website's Index File
a simple trick using .htaccess (24) How To: Change Your Website's Index File a simple trick using the .htaccess file A simple
tutorial which only involves editing one little file. Useful for those of us who have mime-typed
extensions or who are creating lots of test design files and want an easy way to make the design
they like best their default file. Create a file called .htaccess in the /public_html/ folder if
you don't have it. I think one should be there already when you get your site so if it isn't
you should create it anyway! In the file write the following: CODE Di....
Which Media Burner Is Better?
Easy Media Creator 7.0 OR Nero 6.6.0.6 (40) I'm currently using Nero but in the past have used the Roxio product and it seemed to work well
also. My questions are: 1: Which do you prefer of these two? 2: Do you prefer to use any other
software? 3: Is it ok to have both Roxio and Nero on your system at the same time? This is not a
scientific poll or anything, just curious as to what others prefer and why. Thanks....
Php Calculator
Simple but cool. (17) Hello all, I was eally bored the other day. So I decided to make a php calculator just out of the
blue. I set it up and it works really good. You can see mine here . Ill give you guys the source
code too if you want it. Here it is... Name this calculate_forum.html CODE <html>
<head> <title>Calculation Form</title> </head> <body>
<form method="post" action="calculate.php"> <p>Value 1:
<input type="text" name="val1" size="10"></p> <p>....
Looking for simple, php, beginners, easy, apply
|
*RANDOM STUFF*
*SIMILAR VIDEOS*
Searching Video's for simple, php, beginners, easy, apply
*MORE FROM TRAP17.COM*
|
advertisement
|
|