PHP - Dynamic Page Generation
Similar TutorialsI'm praying there's a function somewhere out there that: generates a html form based on the fields of a particular table within a DB (namely mySQL) generates the appropriate form input based on the fields type or notes (ie. for field: avatar_img, it knows to generate a file input) uses the POST method to submit generates and submits SQL insert query to database In addition to that, a similar function that generates a form that allows the editing of records. It doesn't take too long to write these each time myself, but if there's a function that you provide the formname, database driver, table name, whether your form is to insert or edit, that would be quite nifty i think. ie. generateForm(addUser, mySQL, tUsers, insert) Seen any such thing? Many thanks. I wrote this basic script yesterday to process and generate a Google Site Map. And it works! BUT I want to advance this script to accommodate for something else and I don't know the correct path to take from here, but I will tell you what I've found out so far.. Current Situation: 1 - Currently my below script generates urls in the site map like: http://abcdefg.com/index.php?dispatch=products.view&product_id=29826 2 - I have .htaccess configured to rewrite the urls to the products name data like: http://abcdefg.com/pennies/wheat-pennies/lincoln-wheat-penny-cent.html (just an example) and these urls are ONLY active if clicking on the site links themselves - meaning if I enter: http://abcdefg.com/index.php?dispatch=products.view&product_id=29826 directly into the url, the url does not resolve to this natural friendly url name. What Id like to achieve (which I don't know what direction I should be looking!): - I'd like my xml output urls (as current) to be written in the natural format (as in #2 above). FYI here is a current example output item in my sitemap: Code: [Select] <url> <loc>http://abcdefg.com/index.php?dispatch=products.view&product_id=29803</loc> <changefreq>weekly</changefreq> <lastmod>2010-09-24T08:00:00+04:00</lastmod> </url> Can anyone give me some guidance on what method might work for this? Do you think it's more a mod_rewrite issue? Or can this be handled easier with straight up modifications to my below? I'm just a bit confused on what direction I should be looking.. Thanks for any input. <?php header("Content-Type: text/xml;charset=iso-8859-1"); echo '<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; //include('config.local.php'); $cxn = mysqli_connect($config['db_host'], $config['db_user'], $config['db_password'], $config['db_name']); $query = "SELECT cscart_product_descriptions.product_id, cscart_products.product_id, cscart_products.timestamp FROM cscart_product_descriptions JOIN cscart_products ON cscart_product_descriptions.product_id = cscart_products.product_id WHERE cscart_products.status='A' LIMIT 10000"; $result = mysqli_query($cxn, $query); $row = mysqli_fetch_array($result); while ($row = mysqli_fetch_array($result)) { $formatedTime = $row['timestamp']; echo '<url> <loc>http://abcdefg.com/index.php?dispatch=products.view&product_id=' . $row['product_id'] . '</loc> <changefreq>weekly</changefreq> <lastmod>'. date('c',$formatedTime) .'</lastmod> </url>'; } //while ($row = mysqli_fetch_array($result)) echo '</urlset>'; ?> hey guys stuck on this one cant see why it wont work, hope someone can help. im trying to just change the content not the whole page while still only a admin can see it. if you get my jist. but everytime i click the link nothing shows up for some reason. thanks in advance. Code: [Select] <?php session_start(); include("login.php"); ?> <html> <body> <?php if(isset($_SESSION['user'])){ ?> <table width='90%' height='100%' border='1' align='center'> <tr valign='top'> <td><table width='60%' border='0' align='center'> <tr> <td colspan='3' align='center'>You've succesfully logged in.<p></td> </tr> <tr> <td><a href='index.php?page=post.php'>post news</a></td> <td><a href='index.php?page=mail.php'>mailing list</a></td> <td><a href='index.php?page=stats.php'>site stats</a></td> <td><a href='login.php?logout'>logout</a></p></td> </tr> <tr> <td colspan='3'> <?php $page = $_GET['page']; if($page){ include("inc/".$page.".php"); } ?> </td> </tr> </table></td> </tr> </table> ?> <?php } else { die(); } ?> </body> </html> hey guys how you all doing? ok im really looking for some help i've been playing with this code for quite some time now and still not got the hang of it. i'm currently trying to code a dynamic website as a portfolio for my designs and im trying to get to view the news.php file with an 'id' to view in the index file using an include() but for some reason its not happening very well. i keep getting the error message: Warning: include(inc/news.php?id=) [function.include]: failed to open stream: No error in C:\xampplite\htdocs\lukerodham\old\index.php on line 218 Warning: include() [function.include]: Failed opening 'inc/news.php?id=' for inclusion (include_path='.;C:\xampplite\php\PEAR') in C:\xampplite\htdocs\lukerodham\old\index.php on line 218 just wondering if anyone could shed any light on what i may have done wrong thanks guys ive left part of the code below if this will help. Code: [Select] <?php $page = $_GET['page']; $news = $_GET['id']; if(!$page){ getnews(); } else { if($page = news){ include("inc/news.php?id=".$news); } else include("inc/".$page.".php"); } ?> Hi Guys, I'm pulling a html page from a database (html newsletter). In the code I have links that will open a lightbox and allow the user to add news articles into it via ajax. So the html is being updated without being send back to the browser. I have a "save" button which when the user clicks, I want to grab all of the html of the page and save it to the database. Not quite sure how to do this as the html that is being saved, is updated since it was retrieved by the browser. I have written the following php statement and it works to show pages titles if I have an id in the url example. www.mysite.com/index.php?id=3 then the right page title is displayed but if I am on my home page www.mysite.com with no id the page title isn't displayed. I am running the code in the header in the title brackets. here is the code. The last else doesn't display my home page title any help would be great thank you very much... <title> <? if (isset($_GET['id'])) if($_GET['id'] == '1') { echo "LBT Services Page"; } else if($_GET['id'] == '2') { echo "About LBT"; } else if($_GET['id'] == '3') { echo "Contact LBT"; } else if($_GET['id'] == '4') { echo "Your Message to LBT has been Submitted"; } else if($_GET['id'] == '5') { echo "LBT Links Page"; } else if($_GET['id'] == '6') { echo "LBT Back-UP Plans"; } else { echo "LBT Home page"; } ?></title> Hey, I'm trying to make a dynamic php website. So far it's been working fine. All my pages are in a page folder and with my code I'm able to access it via "index.php?page=nameofphpfile" etc. Now I added a page under there with a similar code to the index and it is conflicting. This is the code for the index.php $page=$_GET['page']; if ($page) { include("pages/".$page.".php"); } else { echo "This Page Does Not Exist."; } } On my skin.php page when I try to put a GET variable in, I get the word THIS PAGE DOES NOT EXIST. I'm really stuck and need help, I know it's brief so please help me out here! -Francis Does anyone know how I would display a dynamic page title to my content pages? I currently have my index.php displaying the title for my page, but the content that i am displaying dynamicly also uses this title, want these pages to have their own titles.. Thanks Dear All, Below is a php file for my website invitacoach.com I need to issue passwords myself to members who have already paid up for my services...of which they will then be able to access the advantages of a members area which include Videos, Audios and other publications. Which part of my code am i to edit Below is the SQL and register.php code. SQL CREATE TABLE users ( userid int(25) NOT NULL auto_increment, first_name varchar(25) NOT NULL default '', last_name varchar(25) NOT NULL default '', email_address varchar(25) NOT NULL default '', username varchar(25) NOT NULL default '', password varchar(255) NOT NULL default '', info text NOT NULL, user_level enum('0','1','2','3') NOT NULL default '0', signup_date datetime NOT NULL default '0000-00-00 00:00:00', last_login datetime NOT NULL default '0000-00-00 00:00:00', activated enum('0','1') NOT NULL default '0', PRIMARY KEY (userid) ) TYPE=MyISAM COMMENT='Membership Information'; REGISTER.PHP <? include 'db.php'; // Define post fields into simple variables $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $email_address = $_POST['email_address']; $username = $_POST['username']; $info = $_POST['info']; /* Let's strip some slashes in case the user entered any escaped characters. */ $first_name = stripslashes($first_name); $last_name = stripslashes($last_name); $email_address = stripslashes($email_address); $username = stripslashes($username); $info = stripslashes($info); /* Do some error checking on the form posted fields */ if((!$first_name) || (!$last_name) || (!$email_address) || (!$username)){ echo 'You did not submit the following required information! <br />'; if(!$first_name){ echo "First Name is a required field. Please enter it below.<br />"; } if(!$last_name){ echo "Last Name is a required field. Please enter it below.<br />"; } if(!$email_address){ echo "Email Address is a required field. Please enter it below.<br />"; } if(!$username){ echo "Desired Username is a required field. Please enter it below.<br />"; } include 'join_form.html'; // Show the form again! /* End the error checking and if everything is ok, we'll move on to creating the user account */ exit(); // if the error checking has failed, we'll exit the script! } /* Let's do some checking and ensure that the user's email address or username does not exist in the database */ $sql_email_check = mysql_query("SELECT email_address FROM users WHERE email_address='$email_address'"); $sql_username_check = mysql_query("SELECT username FROM users WHERE username='$username'"); $email_check = mysql_num_rows($sql_email_check); $username_check = mysql_num_rows($sql_username_check); if(($email_check > 0) || ($username_check > 0)){ echo "Please fix the following errors: <br />"; if($email_check > 0){ echo "<strong>Your email address has already been used by another member in our database. Please submit a different Email address!<br />"; unset($email_address); } if($username_check > 0){ echo "The username you have selected has already been used by another member in our database. Please choose a different Username!<br />"; unset($username); } include 'join_form.html'; // Show the form again! exit(); // exit the script so that we do not create this account! } /* Everything has passed both error checks that we have done. It's time to create the account! */ /* Random Password generator. http://www.phpfreaks.com/quickcode/Random_Password_Generator/56.php We'll generate a random password for the user and encrypt it, email it and then enter it into the db. */ function makeRandomPassword() { $salt = "abchefghjkmnpqrstuvwxyz0123456789"; srand((double)microtime()*1000000); $i = 0; while ($i <= 7) { $num = rand() % 33; $tmp = substr($salt, $num, 1); $pass = $pass . $tmp; $i++; } return $pass; } $random_password = makeRandomPassword(); $db_password = md5($random_password); // Enter info into the Database. $info2 = htmlspecialchars($info); $sql = mysql_query("INSERT INTO users (first_name, last_name, email_address, username, password, info, signup_date) VALUES('$first_name', '$last_name', '$email_address', '$username', '$db_password', '$info2', now())") or die (mysql_error()); if(!$sql){ echo 'There has been an error creating your account. Please contact the webmaster.'; } else { $userid = mysql_insert_id(); // Let's mail the user! $subject = "Your Membership at invitacoach.com!"; $message = "Dear $first_name, Thank you for registering at our website, http://www.invitacoach.com You are two steps away from logging in and accessing our exclusive members area. To activate your membership, please click he http://www.invitacoach.com/test/activate.php?id=$userid&code=$db_password Once you activate your membership, you will be able to login with the following information: Username: $username Password: $random_password Thanks! Invita Coach Hi guys, this is very urgent. Can anyone help me out..... I want to generate reports using php and MySQL. I have one table which includes customer_id, full_name, name_with_initials, address, contact_number and gender fields. I want to print the details of all the records of the table. It should be good if results will come on a PDF format. Thanks, Hi, I wanted to make a dynamic php page. I want the user to choose an option you could select in an option box (html) and after that I wish that down the page some text would change. If I take option 1 -> text 1, option 2 -> text 2, ... But this doesn't work, do I need a button or something to made my code running, and how do I have to use it on the same page? Or is it possible to run it automaticly after a new choice? Thanx, Kevin My code: <?php /* Template Name: template voor Ieder1Trainer # */ get_header(); $Tacktiek = ""; $Tacktiek1 = "3-5-2"; $Tacktiek2 = "3-4-3"; $Tacktiek3 = "4-5-1"; $Tacktiek4 = "4-4-2"; $Tacktiek5 = "4-3-3"; $Tacktiek6 = "5-4-1"; $Tacktiek7 = "5-3-2"; $aantalDef; $aantalMid; $aantalAtt; ?> <div id="newsfeed"> <div class="banderol"> <div class="banderol_left"></div> <h1>Dynamic page</h1> </div> <?php if(is_user_logged_in()) { get_currentuserinfo(); //echo 'Username: ' . $current_user->user_login . "\n"; //echo 'User email: ' . $current_user->user_email . "\n"; ?> <!-- Here you choose a tactiek; 1,2,3, .. after that has been choosen I whise the next php-code would be run (the if-then-elseif-...) --> <tr> <td><p class="formulier">Kies je Tacktiek:</p></td> <td> <select size="1" name="$Tacktiek"> <option selected><?php echo $Tacktiek1;?></option> <option><?php echo $Tacktiek2;?></option> <option><?php echo $Tacktiek3;?></option> <option><?php echo $Tacktiek4;?></option> <option><?php echo $Tacktiek5;?></option> <option><?php echo $Tacktiek6;?></option> <option><?php echo $Tacktiek7;?></option> </select> </td> </tr> <!-- This must be run after choosen a tactiek. --> <?php if($Tacktiek == '3-5-2') { $aantalDef = 3; $aantalMid = 5; $aantalAtt = 2; } elseif($Tacktiek == '3-4-3') { $aantalDef = 3; $aantalMid = 4; $aantalAtt = 3; } elseif($Tacktiek == '4-5-1') { $aantalDef = 4; $aantalMid = 5; $aantalAtt = 1; } elseif($Tacktiek == '4-4-2') { $aantalDef = 4; $aantalMid = 4; $aantalAtt = 2; } elseif($Tacktiek == '4-3-3') { $aantalDef = 4; $aantalMid = 3; $aantalAtt = 3; } elseif($Tacktiek == '5-4-1') { $aantalDef = 5; $aantalMid = 4; $aantalAtt = 1; } elseif($Tacktiek == '5-3-2') { $aantalDef = 5; $aantalMid = 3; $aantalAtt = 2; } ?> <!-- After this run, the next code must be run and made a choose of text --> <tr> <td><p class="formulier"> <?php if($aantalDef == '3') { echo "3 defs"; //Choosen text if aantalDef == 3 } elseif($aantalDef == '4') { echo "4 defs"; //Choosen text if aantalDef == 4 } elseif($aantalDef == '5') { echo "5 defs"; //Choosen text if aantalDef == 5 } ?> </p></td> <!-- Other choose of options, but always the same options. --> <td> <select size="1" name="$Speler4"> <option selected><?php echo $NaamDef1;?></option> <option><?php echo $NaamDef2;?></option> <option><?php echo $NaamDefMid1;?></option> <option><?php echo $NaamDefMid2;?></option> <option><?php echo $NaamDefMid3;?></option> <option><?php echo $NaamDefMid4;?></option> <option><?php echo $NaamDefMid5;?></option> <option><?php echo $NaamDefMid6;?></option> <option><?php echo $NaamDefMid7;?></option> <option><?php echo $NaamDefMid8;?></option> <option><?php echo $NaamDefMidAtt1;?></option> <option><?php echo $NaamDefMidAtt2;?></option> <option><?php echo $NaamDefMidAtt3;?></option> </select> </td> </tr> <?php } else{ echo 'U dient in te loggen.'; } ?> </div> <?php get_footer(); ?> Hi guyz, I am looking to create a dymanic comment box for my website where already logged in users can comment on webpages. It is quite a challenge getting to dynamically display only the comments a particular user posted on a web page. What I mean is I would like to be able to click on a page, see only the comments logged users posted on that page, and then post my own comment on that page. At the moment I created a comment box for my webpages but the issue is my posted comments on one particular page is displaying on all web pages with is comment system..This is the problem and it is very difficult to find helpful material hopefully you guyz can come to the rescue. Please guys any help or suggestions are more than welcome. Thanks Kdiamonds Hi everybody I am a PHP rookie for now, and I want to reload the same dynamic page - it's content in several languages - by clicking little flags which are located at some point on the page - AND ITS NOT WORKING. Clicking on the flag triggers a PHP script which basically says Code: [Select] ]$_SESSION['lang'] = <Some_language>; require ('webpage.php'); where webpage.php is the dynamic page, in different languages, with it's content drawn out from a database (which contains the content in all languages I chose to display, blah, blah) Funny thing - when I look at the page html (View Page Source) - it seems OK (identical from one page to the next) ! But WHAT is displayed after the first attempt to change the language is not. Is something fundamentally wrong with my approach ? Mike Hi So I have successfully set up a website and database where a user can create a listing and view listings on a listing details page. The viewing can only be done, however, only from either from either running a search query from the search form or from clicking one of the listings from the listing table. The listings are not being indexed from the search engines from the direct page, instead from the listing table which is about 3,000 listings, not very user friendly to land on this page and have to go through the table or use the table filter. Here's what I am trying to accomplish: A web page that has a dynamic presence / URL like a Wordpress page: http://www.mysite.com/listing_title/ The title of the page has the listing information in it: This page is about a $listing_title $listing_item listing number $listing_number that is online! Each individual Listing / page is indexed on the search engines and has a direct link to it I am familiar with PHP and have created this site but I am far from an expert! Please give me a code example or link to one because if you just say "do this to this and that" you will totally loose me. Thank you so much for any help. Hi i am using a script to upload an image and resize it twice first to create the large image and then again to create a thumbnail. The large image is being created fine and is uploading ok. I'm using the following code to then make the thumbnail but it does not appear to be working ( well nothing is in the thumbnail image folder i expect it to be anyways) can anyone see anything obvious that i am doing wrong ? Many Thanks /////////////////////////// Create a Thumbnail of the Image //////////////////////////////////// list($width, $height) = getimagesize($upload_image); // this is the large image which has apready been uploaded $ratio = $height/$width; if($ratio >= '1') // portret { $ht_tmb = 150; $br_tmb = 150/$ratio; } else { // landscape $ht_tmb = 150*$ratio; $br_tmb = 150; } // create thumb $source = imagecreatefromjpeg($upload_image); // The large image already uploaded //--- resize uploaded file $resize = imagecreatetruecolor($br_tmb, $ht_tmb); imagecopyresized($resize, $source, 0, 0, 0, 0, $br_tmb, $ht_tmb, $width, $height); imagejpeg($resize, "gallery_images/small/" .$filenamefd); $image = imagecreatefromjpeg("gallery_images/small/" .$filenamefd); imagejpeg($image, "gallery_images/small/" . $filenamefd); // end of making thumb ///////////////////////////////////////////////////////////////////////////////////////////////// Hello everyone, I am interested in creating a site with similar capabilities to this one: http://www.inkpixi.com/item/Classic+University/A223/295/item.html On this site, enter your name name and hit "Preview". The artwork is created using your name as a variable and other parameters to define how the artwork looks. I have a bunch of variables and I want to generate images (dynamically) using these variables. Any ideas or suggestions on how they do this on InkPixi.com? Thank you in advance, Tim Hi all, sorry cos there is no code. please how can i generate pairs (in twos, threes, fours or five) from a given set of numbers. the numbers are to be typed in the form text field and when click generate(submit button) it brings out the pair of numbers. thanks in advance my form Code: [Select] <form id="form1" name="form1" method="post" action=""> <table width="100%" border="0" cellspacing="2" cellpadding="1"> <tr> <td width="21%">Input Numbers : </td> <td width="79%"><input name="numbers" type="text" id="numbers" size="50" /></td> </tr> <tr> <td> </td> <td><input name="generate" type="submit" id="generate" value="Generate" /></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"> </td> </tr> </table> </form> I'm looking for a function that creates a random string that contains random letters, numbers and symbols. Also it needs to generate it in a way that there are no repeating characters. Any ideas? I have set this up with a form on another page so that they can generate a runescape stat signature, although there is something wrong, if they do not select a font it comes up with an error. Here is the Code: Code: [Select] <?php header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); $user = ""; $img = ""; $fnt = ""; if(isset($_GET['user'])) { if(!empty($_GET['user'])) { $user = $_GET['user']; } } if(isset($_GET['img'])) { if(!empty($_GET['img'])) { $img = $_GET['img']; } else{$img='blue';} } else{$img='blue';} if(isset($_GET['fnt'])) { if(!empty($_GET['fnt'])) { $fnt = $_GET['fnt']; } else{$fnt='arial';} } else{$img='blue';} if(isset($_POST['user'],$_POST['img'],$_POST['fnt'])) { if(!empty($_POST['user'])) { $user=$_POST['user']; } if(!empty($_POST['img'])) { $img = $_POST['img']; } if(!empty($_POST['fnt'])) { $fnt=$_POST['fnt']; } } //Skill Grabs $order = array("Overall", "Attack", "Defence", "Strength", "Hitpoints", "Ranged", "Prayer", "Magic", "Cooking", "Woodcutting", "Fletching", "Fishing", "Firemaking", "Crafting", "Smithing", "Mining", "Herblore", "Agility", "Thieving", "Slayer", "Farming", "Runecraft", "Hunter", "Construction", "Summoning", "Dungeoneering"); $get = file_get_contents("http://hiscore.runescape.com/index_lite.ws?player=$user"); $get = explode("\n", $get); $i = 0; foreach ($order as $key => $value) { $value = strtolower($value); $temp = explode(",", $get[$i]); $temp = array("rank" => $temp[0], "level" => $temp[1], "exp" => $temp[2]); $stats[$value] = $temp; $eval = "\$$value = array(\$temp[\"rank\"], \$temp[\"level\"], \$temp[\"exp\"]);"; eval($eval); $i++; } //End Skill Grabs $image = imagecreatefrompng("http://slay2day.x10.mx/highscores/signatures/".$img.".png"); $font = "/fonts/".$fnt.".ttf"; $color = imagecolorallocate($image, 255,255,255); ImageTTFText ($image, "7", 0, 280, 10, $color, "/fonts/arial.ttf","Slay2day"); ImageTTFText ($image, "12", 0, 240, 55, $color, $font,$user); if(is_numeric($overall[0])) { if($overall[0]==-1) { ImageTTFText($image, "11", 0, 230, 105, $color, $font,"2000000+"); } else { ImageTTFText($image, "11", 0, 240, 105, $color, $font,$overall[0]); } } else { ImageTTFText($image, "11", 0, 230, 105, $color, $font,"2000000+"); } ImageTTFText ($image, "10", 0, 27, 20, $color, $font,$attack[1]); ImageTTFText ($image, "10", 0, 27, 42, $color, $font,$strength[1]); ImageTTFText ($image, "10", 0, 27, 64, $color, $font,$defence[1]); ImageTTFText ($image, "10", 0, 27, 88, $color, $font,$hitpoints[1]); ImageTTFText ($image, "10", 0, 27, 114, $color,$font,$ranged[1]); ImageTTFText ($image, "10", 0, 70, 20, $color, $font,$prayer[1]); ImageTTFText ($image, "10", 0, 70, 42, $color, $font,$magic[1]); ImageTTFText ($image, "10", 0, 70, 64, $color, $font,$cooking[1]); ImageTTFText ($image, "10", 0, 70, 88, $color, $font,$woodcutting[1]); ImageTTFText ($image, "10", 0, 70, 114, $color,$font,$fletching[1]); ImageTTFText ($image, "10", 0, 117, 20, $color, $font,$fishing[1]); ImageTTFText ($image, "10", 0, 117, 42, $color, $font,$firemaking[1]); ImageTTFText ($image, "10", 0, 117, 64, $color, $font,$crafting[1]); ImageTTFText ($image, "10", 0, 117, 88, $color, $font,$smithing[1]); ImageTTFText ($image, "10", 0, 117, 114, $color,$font,$mining[1]); ImageTTFText ($image, "10", 0, 162, 20, $color, $font,$herblore[1]); ImageTTFText ($image, "10", 0, 162, 42, $color, $font,$agility[1]); ImageTTFText ($image, "10", 0, 162, 64, $color, $font,$thieving[1]); ImageTTFText ($image, "10", 0, 162, 88, $color, $font,$slayer[1]); ImageTTFText ($image, "10", 0, 162, 114, $color,$font,$farming[1]); ImageTTFText ($image, "10", 0, 212, 20, $color, $font,$runecraft[1]); ImageTTFText ($image, "10", 0, 212, 42, $color, $font,$construction[1]); ImageTTFText ($image, "10", 0, 212, 64, $color, $font,$hunter[1]); ImageTTFText ($image, "10", 0, 212, 88, $color, $font,$summoning[1]); ImageTTFText ($image, "10", 0, 212, 114, $color,$font,$dungeoneering[1]); header("Content-type: image/png"); imagepng($image); imagedestroy($image); //Logging $url = getenv("HTTP_REFERER"); // connect to the database include('connect-db.php'); //variables date_default_timezone_set('Pacific/Auckland'); $datepickerbox = $_POST['datepickerbox']; $datepickerbox = date("Y-m-d H:i:s", time($datepickerbox)); echo $datepickerbox; // save the data to the database mysql_query("INSERT signature SET user='$user', img='$img', time='$datepickerbox', url='$url', font='$fnt'") or die(mysql_error()); //End Logging ?> if they do not have a font i get: Code: [Select] Warning: imagettftext() [function.imagettftext]: Could not find/open font in /home/slay2day/public_html/highscores/signatures/signature.php on line 130 but of they dont choose a font i want it to use arial... |