Blessed
Members-
Content Count
143 -
Joined
-
Last visited
Everything posted by Blessed
-
thanx shadowx for givven that last info for me thanx for the support
-
Header function Greetings we are going to use the header() funtion to redirect start making a file called page.php at the top of the file add <?php?> Example 1After <?php add header('Location: http://trap17.com;; the LOCATION meanswhere you want it to go. Example 2 you also can define a file that you want to redirect to After <?php add header('Location: index.php'); Example 3you also can add a timer to it After <?php add header('Refresh: 0; url=http://trap17.com; ); Refresh: 0; means that it will refresh to the url you entered andthe 0; means the seconds it wait to refresh. Example 4 now if you want to go to the root of the site use this After <?php add header('Refresh: 3; url=/'); Have fun with this tutorial..
-
Thanx for support.i will try to add some more tutorials later
-
Php - Randomize Web Title using arrays and the random function
Blessed replied to Blessed's topic in General Discussion
thanx for the reply m8'si will check if i can add a once a month funtion to it ;)if someone can help me with that that would be great -
Simple Last Modified This script will shows when a page was last editted. make a new file name it (yourpage.php) We start at the top of the file add <?php?>now after <?php add $ftime = filemtime("yourpage.php"); // now we use the date function do define the file date echo("file was last modified on: "); echo(date("m/j/y h:i", $ftime)); m/j/y h:i means Thats it.. have fun with it
-
PHP - Randomize Web Title with the rand function... Define the variables numbers we start at number 0 <?php $title[0] = "Web title 0"; // Title 0 $title[1] = "Web title 1"; // Title 1 $title[2] = "Web title 2"; // Title 2 $title[3] = "Web title 3"; // Title 3 $title[4] = "Web title 4"; // Title 4 ?> now we use the rand() function to get a randomize the web title. rand(0, 4) means we start at 0 and end at 4 i can get 0,1,2,3,4 one of those. It depends how many arrays you have <? // get a random number $randomize = rand(0, 4); // Change four to how many arrays you have echo ($title[$randomize]); ?> see it in action. ++++++++++++++++++++ <?php $title[0] = "Web title 0"; // Title 0 $title[1] = "Web title 1"; // Title 1 $title[2] = "Web title 2"; // Title 2 $title[3] = "Web title 3"; // Title 3 $title[4] = "Web title 4"; // Title 4 // get a random number $randomize = rand(0, 4); // Change four to how many arrays you have ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; <html xmlns="https://www.w3.org/1999/xhtml/"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title><?php echo ($title[$randomize]); ?></title> </head> <body> Just a simple PHP tut </body> </html>
-
Thanx for the tutorial m8 Nice one this explains a lot to me <?php$name = "<b>ghostrider</b>";$text = "Thanx Realy nice tutorial ";print "$text" . " " . $name . "!";?> Notice from jlhaslip: added code tags.
-
thamx for this tutorial mani really need to check this out
-
What's Your Favorite Game System - Console select one from each poll
Blessed replied to ICE-XG's topic in Computer Gaming
i veted the Sony ps2i haven't played the Plastation 3 yeti'm looking forward to it -
GreetingsNo Problem and thanx for the quick Reply
-
Greetings i cant creat a free hosting account i get this error https://support.xisto.com/ Parse error: syntax error, unexpected ':', expecting ',' or ';' in /home/Xisto/public_html/process/create.php on line 168 tnx in advance
-
i just Updated one of my topicslook above
-
do you know where i can get some
-
wow that is one nice tut man with a nice resulti like the tutorial and its easy to follow the steps you are givinthanx m8
-
i have a sagem x5 an old one
-
Greetings MLB 07: The Show https://www.playstation.com/en-us/ i thinks this is the best baseball game ever. also online playable what do you guy's think
-
i like all the nfs serriesmostly need for speed underground 2 and need for speed most wanted.i havent play the need for speed carbon yet i'm looking forward to buy it :lol:somebuddy played it on the playstation 2 version ??
-
Complete Signature Tutorial Adobe Photoshop 7+
Blessed replied to Slay's topic in General Discussion
Greetingscan somebuddy pleas reuploed the images so can maki the tutorialtnx in advance -
Add a simple pagination to it like [Previous] | [Next] <html><head><title>Simple G Book with pagination</title></head><body><table> <?phpdefine('ROWS_PER_PAGE', 5);/*if ?page is emty returns to page 1*/if (!isset($page) || $page < 1) { $page = 1;}/*Count the lines*/$result = mysql_query("select count(id) from g_book", $dbconn);$row = mysql_fetch_row($result);$numrows = $row[0];mysql_free_result($result);if ($numrows < 1) { // There is no data in the g_book! die ("There is no data in the g_book!");}/*Check how many pages in total are needed*/$numpages = ceil($numrows / ROWS_PER_PAGE);if ($numpages < $page) { $page = $numpages;}/*many rows to display per page, we can work out the offset*/$offset = ROWS_PER_PAGE * ($page - 1);/*construct the query, and pass in the limit clause*/$query = "select id, g_title, g_poster, g_date, g_text from g_book limit $offset, ".ROWS_PER_PAGE;$result = mysql_query($query, $dbconn);if (mysql_num_rows($result) < 1) { // We know we _should_ have a result, but we haven't die("No data retrieved!");}/*Do the loop*/while ($row = mysql_fetch_assoc($result)) {// define some things $g_title = $row['g_title']; $g_date = $row['g_date']; $g_text = $row['g_text']; $g_poster = $row['g_poster']; ?><table style="border:solid #999999 1px;"width="200"> <tr> <td><?php echo $g_title;?> | <?php echo $g_poster;?></td> </tr> <tr> <td><?php echo $g_text;?></td> </tr> <tr> <td><?php echo $g_date;?></td> </tr></table><?php}/*Free the memory used for this result set*/mysql_free_result($result);?></table><!-- If necessary, display a prev button --><?php if ($page > 1) { ?><a href="<?php echo $PHP_SELF; ?>?page=<?php echo $page - 1; ?>">[ Previous Page ]</a><?php } ?><!-- If necessary, display a next button --><?php if ($page < $numpages) { ?><a href="<?php echo $PHP_SELF; ?>?page=<?php echo $page + 1; ?>">[ Next Page ]</a><?php } ?></body></html> have fun ... :( credits ??
-
Simple Mysql Query Limitting Part 1 Make a file called gbook.php. at the first line start with. <?php$conn = mysql_connect("localhost","username","password");mysql_select_db("database") or die(mysql_error());so we can make a connection to the database Part 2 after add. if the ?limit == empty it automaticly returs to 5 // If mypage?limit=blah is not defined returs 5if ( $_GET['limit'] == NULL ){ $limit = 5;}// Elseelse{ $limit = $_GET['limit'];} Part 3 Now we center the table and built up the links <div align="center"><!-- You can add more if you want --><a href="index.php?limit=10">Show 10</a> <a href="index.php?limit=20">Show 20</a> Part 4Select everything from the g_book table thats what "SELECT * FROM g_book" means <?php$query = mysql_query("SELECT * FROM g_book LIMIT '$limit'") or die(mysql_error()); Part 5 with the while funtion we start the loop. and we define some things while ($sql = mysql_fetch_array ($query) )// Loop begin{// define some things $g_title = $sql['g_title']; $g_date = $sql['g_date']; $g_text = $sql['g_text']; $g_poster = $sql['g_poster'];?> Part 6 Now we build the results table. inside the while loop. now we use echo to output the things we just defined. <table style="border:solid #999999 1px;"width="200"> <tr> <td><?php echo $g_title;?> | <?php echo $g_poster;?></td> </tr> <tr> <td><?php echo $g_text;?></td> </tr> <tr> <td><?php echo $g_date;?></td> </tr></table> Part 7 Now we close the while loop and close the div. <?php// Close the loop}?></div>
-
give me some time.will post it soon :lol:
-
Simple MySQL Query Limiting <?php// If mypage?limit=blah is not defined returs 5if ( $_GET['limit'] == NULL ){ $limit = 5;}// Elseelse{ $limit = $_GET['limit'];}$query = mysql_query("SELECT * FROM members LIMIT '$limit'") or die(mysql_error());while ($sql = mysql_fetch_array ($query) ){ echo $sql['mem_name'] . '<br>';}?> Have fun..
-
Display The Current Date/time With a simple PHP code
Blessed replied to Unholy Prayer's topic in Programming
i found this on BioRust - A = Uppercase 12hr time syntax eg. PM- a = Lowercase 12hr time syntax eg. pm- D = Day eg. Fri - d = Day eg. 03 - F = Full Text Month eg. January - G = Hours in 24 hour format without leading zeros eg. 17 - g = Hours in 12 hour format without leading zeros eg. 7 - H = Hours in 24 hour format with leading zeros eg. 17 - h = Hours in 12 hour format with leading zeros eg. 07 - i = Minutes eg. 29 - M = Month eg. Jan - m = Month eg. 01 - O = GMT time difference in hours eg. +0400 - S = Day of month suffix eg. st, nd, rd, or th. - s = Seconds eg. 28- T = Timezone setting eg. GMT, PST, EST, etc - t = Total number of days in the month eg. 28, 31, etc. - U = Seconds since the UNIX epoch eg. 1041604168- W = Week number in year eg. 42 (42nd week in the year) - w = numeric representation of the day eg. 1 = monday, 2 = tuesday, etc.- Y = Year eg. 2003 - y = Year eg. 03- z = Day of the year eg. 002 A Few ExamplesTo finish this tutorial there now follows a few examples of standard date/time strings and the values they output. I hope you enjoyed this tutorial and good luck with PHP!;)Date String Example Output date("F j, Y, g:i a"); - March 10, 2001, 5:16 pm date("m.d.y"); - 03.10.01 date("j, n, Y") - 10, 3, 2001 date("D M j G:i:s T Y"); - Sat Mar 10 15:16:08 PST 2001 date("H:i:s"); - 17:16:17 date('\i\t \i\s \t\h\e jS \d\a\y.'); - It is the 10th day. -
wow thanx a loti really need some :lol: