| Photoshop palette |
| Customizing Max Interface |
| Learn Flash |
| Dreamweaver Enable/Disabled script |
| Understand Sessions |
| Redefine tags and create classes with Css |
navigation
Share Tips
Php file()
file() reads a file line by line. Every line becomes an element of an array array file (string filename [, int use_include_path])
Php Script - Send this page to a friend - Page 1
A php walkthrough that shows how to realize a useful php script to an url of your site via mail.
First of all, we need just two pages to realize this script, one (but the total number depends on you) with the send this page script, and a page that we will call sendpage.php with the form.
If your site uses include_once() function, include this few line of code in your functions page, if not just add this code only in the page/s to send the exact url via mail.
Please note: the script and the sendpage.php page have to be in the same directory, if not edit this line <a href=[edit-here]sendpage.php
The code:
<?php
$myurl = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
echo "<p><a href=sendpage.php?myurl=" .$myurl. ">send
this page to a friend</a></p>";
?>
Please note: some browsers may cut the code and give you the impression of
two lines of code instead of one. So, copy and paste the highlighted portions
of code in word or notepad.
$myurl is the variable that stores the full url.. i.e. the one that you see
in your browser, use myurl or a variable name of your choice but avoid $url
‘cause it is too common. Another variable with the same name in your
site usually forgotten is ever possible.
$_SERVER['HTTP_HOST'] returns your domain name ex. www.yoursite.com
$_SERVER['REQUEST_URI'] returns the url from index.php/dir/page
Go to page 1 - 2
