How To Create a New Php Page with PHP
Some times You should not make a new php page with php …there are much better ways to do it
Other than using fopen() but if you are stuck here is the code …run it on a local testing server !
and you will see it works ! basically this scrip takes input from a form then creates a new php file with the supplied data …note if you are going to use this it is an open invitation for a hacker to Kill your website / app …because it will allow you to embed <?php Executable script so beware!
<?php
// This script creates a new php file
if ($_POST["sub"]) {
$thename = $_POST["filename"];
$thelink = $_POST["link"];
$sub = $_POST["sub"];
//error_reporting(0);
$i=1;
while($file = fopen("$thename"."$i.php", "r")) { fclose($file); $i++; }
if($file = fopen("$thename"."$i.php", "w")) {
// the html of the page with the value of link
$html = "<html>\n<body>\n $thelink \n</body>\n</html>";
if(fwrite($file, $html) === false) { echo "Could not write"; exit; }
fclose($file);
$newfile="$thename"."$i.php";
// this is the redirect to the new file but you can change this
header("Location: $newfile");
/* Do Some thing with a database
$con = mysql_connect($host, $user, $pass) or die ("could not connect");
mysql_select_db($db) or die ("$db Does not exist");
*/
}
}
else {
echo "<form method=post action='".$_SERVER["SCRIPT_NAME"]."'>\n";
echo "The New File Name: <input name='filename'>\n";
//echo " Ad link: <input name='link'>";
echo "<br/> Ad Html Code<br/><textarea name='link' cols='40' rows='3' id='link'> </textarea>";
echo "<br/><input type='submit' name='sub' value='Submit'>\n</form>\n";
echo "<br/>Example copy this and paste it in to the above html box <br/> <p align='center'><p align='center'><br>
<a target='_blank' href='http://secure.hostgator.com/cgi-bin/affiliates/clickthru.cgi?id=taggart99'><br>
<img src='http://www.hostgator.com/affiliates/banners/hostgator-300x250.gif'/><br>
</a></p></p>";
}
?>
How To Display Content Based on Ip (Geolocation)
Let me show you how to do Geolocation Content based on ip address !(with php and mysql)
first you need a database eg make a database call it what ever you want now you will need to Get A Database of ip 80% world wide accuriate Click Here to download ( ip2nation )
Then insert import the sql (taken from ip2nation but small changes)
note Go to http://ip2nation.com/ip2nation/Sample_Scripts
and Get it …the bottom of code is different examples of use
<?php
////////////////dot use this get it from ip2nation.com
$server = ''; // MySQL hostname
$username = ''; // MySQL username
$password = ''; // MySQL password
$dbname = ''; // MySQL db name
$table = "ip2nation";
$db = mysql_connect($server, $username, $password) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$sql = 'SELECT `country`FROM
`$table`
WHERE
`ip` < INET_ATON("'.$_SERVER['REMOTE_ADDR'].'")
ORDER BY
`ip` DESC
LIMIT 0,1';
list($country) = mysql_fetch_row(mysql_query($sql));
// use a switch statement for redirect
switch ($country) {
case 'ca':
// Get the Canadians to a canadians site
header('Location: http://www.yoursite.ca/');
exit;
case 'us':
// And redirect US visitors to your .com
header('Location: http://www.yoursite.com/');
exit;
default:
// The rest of the world can go to defult
header('Location: http://www.yoursite.com.au/');
exit;
}
//Get The Basic Idea include a file
if($country = 'ca'){
include ("canada.php");
}else{
include ("USA.php");
}
// Display an image
switch ($country) {
case 'ca':
// show canada flag
echo"<img src='images/canada.jpg' />";
exit;
case 'us':
// show us flag
echo"<img src='images/usa.jpg' />";
exit;
default:// the default flag
echo"<img src='images/australia.jpg' />";');
}
?>
try it
http://taggartjensen.com/ip
Have Fun this demo is for Australia, Canada, Usa
Float A div with javascript and css
Float A div with java script and css
for an example click Here
if you want to know how to float a div with javascript
then here is the file you need
this is a good little script if you want to ad some content to the side of you website like an ad ..or something or a flash video …what everyou want to put in a floating div!
Using javascript there are 2 examples 1 that is a fixed floting div, and another that div flots down the side of your page it is cool.call it a div layer call it what ever you want but it works !
Set Up Wamp for Web Development
If you are like me and develop on a Testing Server ( I use Wamp )
Get It at http://www.wampserver.com/
This Post will show you How To get the most out of wamp ..(your localhost )
WATCH This Play list and follow along : NOTE YOU DONT NEED “npad2″
NOW THAT YOU ARE ALL SET UP you will find …eventually wamp has a database size limited
it took me a wile before I found this out ! but …
you might need to upgrade the size of the database you can import:
I found the answer at the Wamp forms :
Posted by: yfastud (Moderator)
Date: December 08, 2008 12:14PMTry these different settings in C:\wamp\bin\apache\apache2.2.8\bin\php.ini
Find:
post_max_size = 8M
upload_max_filesize = 2M
max_execution_time = 30
max_input_time = 60
memory_limit = 8MChange to:
post_max_size = 750M
upload_max_filesize = 750M
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000MThen restart wamp to take effect
Also if you are new to Wamp after you install it you need to go to php myadmin
and set your password to the root user then refresh (you will know because you will get kicked out )
then go to
C:\wamp\apps\phpmyadmin2.11.6\config.inc.php
and find neer line 71 ($cfg['Servers'][$i]['auth_type'] ) = ‘config’;)
and change to ($cfg['Servers'][$i]['auth_type'] ) = ‘http’;)
then go back to phpmyadmin you will see you need to log in with you user name and password
(so therefor you can realy start using your testing server! )
Mysql and Php …To Flash?
The other day I finely was able to make an application that
Well … because I am an internet marketer, at hart… was able to
Make an opt in ..with php and mysql which then generates an xml file which is used by a .swf Flash file! This is a good idea if any one needed a “viral” video
Because the user gets to ‘interact’ with the video and then … send to friends … but at the same time gets captured …and opted in …
So my advice when thinking Flash and Mysql USE xml as the go between !
My example is so Basic at the moment have fun http://www.landingpagerus.com/
Free Email Marketing Software?
Ok Every one is talking about Aweber And 1 shopping cart
for there Email Marketing Systems or their email marketing software that “automate’s email follow up and email newsletter delivery.”
well that is fine … but why ? is it because of the features?
to make shore that their email marketing campaigns (“newsletters”)are getting to their subscribers or (opt-iners ) … I think I just made up a word ? oh well…
or is it because of the ease of the opt-in form generators, or is because of the fancy use of JavaScript for the pop up box ?
well my friend there is a way to do this free !!!
the answer Is Infinite Responder or http://infinite.ibasics.biz/
or if you dont like that go to http://sourceforge.net/softwaremap/trove_list.php?form_cat=30
and take your pick!
Please go to the above site and download it
when I installed the program I was blinded by the Design aka (abit ugly but if you are that vain just change the back ground image and header …I did)
and found that on my server I was getting sql errors when I opted in the root of the problem is “s.php”
I have fixed it for my hosting provider eg the right sql syntax which you can download here
DOWNLOAD MY CUSTOM Infinite Responder (no warranty at all and no responsibility on me) !!!
Watch his videos and stuff it is a great application and the double op in process works Great !!!
Beats Paying Each Month for Aweber And or 1 shopping cart !
so if you want Free Email Marketing Software this is it
Here are some of its fetures
- GPL Licensed
- Single or Double Opt-In
- Easy web-based subscriptions
- Email-based subscriptions
- Sequential and absolute autoresponder timing
- Newsletter style mail bursts
- Easy bounce handling
- Unlimited messages and lists
- Individual scheduled messages
- Full web-based control panel
- Easy setup and installation
- Easily add emails individually or in a group
- HTML and text email messages
- Multi-part HTML ensures readability
- Strong security features
- Numerous remote subscription possibilities
- 30+ custom tags to personalize your mail
- Convenient in-line help system
- HTML editor plug-in
- Global blacklist capability
- Simple templates allow easy customization
- RFC compliant emails aid deliverability
- Unlimited custom fields
- Subscription referral tracking fields
- Daily and per-batch throttling
- Queued message cache
- Efficient mail delivery functions
- Easy opt-in and opt-out redirect
ALL YOU NEED IS WHAT YOU all ready have (if you have php hosting)
- A web server (Apache or IIS)
- PHP 4.3 or greater (the 5.x series seems to work fine)
- MySQL 4 or greater (MySQL 5 is highly recommended)
- IMAP library is required for bounce and mail checking
- Crontab for scheduled mail sending
to demo it subscribe to my newsletter!
later ill show you how to do the tricky java thing like randomad.net
(this site http//randomad.net is one of mine but does not use the above email software yet ! )
it uses my crapy one i made but still works !











