Archive for the ‘web development’ Category

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'>&lt;p align='center'&gt;<br>
 &lt;a target='_blank' href='http://secure.hostgator.com/cgi-bin/affiliates/clickthru.cgi?id=taggart99'&gt;<br>
 &lt;img src='http://www.hostgator.com/affiliates/banners/hostgator-300x250.gif'/&gt;<br>
 &lt;/a&gt;&lt;/p&gt;</p>";
}
?>

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

float Some Div’s .zip

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:14PM

Try 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 = 8M

Change to:
post_max_size = 750M
upload_max_filesize = 750M
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M

Then 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! )

Subscription

Fill out the form below to signup to my newsletter and You Can Get New Cool free Scripts , advice ...ect

Our strict privacy policy keeps your email address 100% safe & secure.



























Ads1

Best Web Hosting
Web Hosting Supported by Experts.
50% OFF Hosting. Free $25 Adwords!
justhostrus.com





Accept Payment Online?
PayPal Merchant Account
Lets you Accept Secure Payment
www.PayPal.com/GetPaid





Cool Twitter Automation
The Best thing to happen
To Twitter EVER Free Ac!
www.tweetitlater.org






Godady Domain Name
Save Money On Domain Names
20% Of Domain Name Special!
www.Godady.com.au






Affiliate Tracking
Affiliate Tracking Software
Software Solutions for Every business
www.idevtracking.com





Designed by Taggart Jensen .