Jump to content

digi duck

Members
  • Posts

    41
  • Joined

  • Last visited

    Never

Everything posted by digi duck

  1. Ok for anyone interested i've managed to solve it. I changed the text boxes to have the same function which activated onkeyup this function then saves each value as a variable and adds them on to the url as shown below: function change() { var name=document.forms.filter.name.value var city=document.forms.filter.city.value if (name=="" & city=="") { document.getElementById("results").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("results").innerHTML=xmlhttp.responseText; } } var url="results.php" url=url+"?name="+name; url=url+"&city="+city; xmlhttp.open("GET",url,true); xmlhttp.send(); }
  2. Hi there. I am trying to create a filtering system for results in a database (i.e. user types in inputs and it only show the results with that text). I have it half working in that they can filter by name and city individually, however i would like it so they can filter by both together. For example if i have the following data: NAME CITY john new york james london bob tokyo At the moment if they typed in the name filtering box "j" it would show results row john and james, however if they then went and typed in "y" in the city filtering box it would ignore the previous filter and show the john and bob (as y in new york and tokyo). What I want it do is for it to filter both and therefore only show the john row. So far I have the following: For the user submission page <script type="text/javascript" src="js/filter.js"></script> <form> Search by Name:<input type="text" name="name" onkeyup="showName(this.value)"> Search by City:<input type="text" name="city" onkeyup="showCity(this.value)"> </select> </form> <div id="row"></div> For the Javascript page I have: function showName(name) { if (name=="") { document.getElementById("row").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("row").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","results.php?name="+name,true); xmlhttp.send(); } function showCity(city) { if (city=="") { document.getElementById("row").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("row").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","results.php?city="+city,true); xmlhttp.send(); } And lastly for the php file i have: //get the parameters from URL $name=$_GET["name"]; $city=$_GET['city']; //Select Results $sql="SELECT name, city FROM $tbl_name WHERE name LIKE '%$name%' AND city LIKE '%$city%' $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['name'] . "</td>"; echo "<td>" . $row['city'] . "</td>"; echo "</tr>"; } I think it is doing this because it only runs one function at a time and this overwrites the last one therefore i think i need a function to send all the parameters at once even if they've not been changed. Unfortunately im very new to programming and have very little experience with javascript so thought id ask the experts. Thanks in advance for your help!!
  3. Hi. I was hoping someone could tell me whether this is possible and if so how I could go about doing it preferably with a tutorial as im pretty new to programming. I have a database that will contain 100's of records. I want users to be able to select filter parameters on this data by both text and checkboxes with it automatically updating the results (hopefully without page reload). I managed this so far using this Jquery filter script: http://www.picnet.com.au/picnet-table-filter.html. As this will table will have so many rows however I think it would take ages to load so instead I would like to paginate the table but still allow filters applied to affect all records not just the ones displayed on the current page. Any ideas on how i could do this? Thanks in advance for your help.
  4. Thanks for your help. Putting the session_start(); at the top of the admin page did it. Cant believe it was so simply in the end. cheers!
  5. Hi. I am trying to create a very simple admin login page that will let only me access a number of pages. I am trying the following code for the login page: <?php session_start(); // Define your username and password $username = "username"; $password = "password"; if ($_POST['txtUsername'] == $username && $_POST['txtPassword'] == $password) { $_SESSION['admin']="true"; header("location: admin.php"); } ?> ### HTML code and form for entering in username and password with action echoing it back to itself ### On the admin.php page i then try: <?php if ($_SESSION['admin'] != "true") { header("location: login.php");} else { ?> ### code for the rest of the page ### I am fairly new to all this and cant understand why its remaining on the login page and not sending me to admin.php when the password and username are correct. Is this the correct way to be going about it? I envisaged simply adding the above code to the top of any page only the admin could see. Any help is much appreciated.
  6. Thanks for your reply, however im new to php and dont fully understand what is going on. Could you explain it a bit to me please. Thanks a lot.
  7. Hi. I am pretty new to this and am having difficulty looping through rows. I have the code below which first selects a name based upon the id sent from a GET on a separate page. It then has a second select query to get the data from all rows which have this name. I then want it to display the name, and city once but all of the comments. The code below only shows one of each though. Thanks in advance <?php $id = $_GET['id']; // Retrieve data from database $sql="SELECT landlord_name AS name FROM $tbl_name WHERE id=$id"; $query=mysql_query($sql); //loop through the rows while ($rows = mysql_fetch_array($query)){ $name = $rows['name']; } $sql2="SELECT city, landlord_name, landlord_comments FROM $tbl_name WHERE landlord_name= '$name'"; $query2=mysql_query($sql2) or die(mysql_error()); while ($data = mysql_fetch_array($query2)){ ?> <table width="600" border="1" cellspacing="0" cellpadding="0" align="center"> <tr> <div id="name"><? echo $name ?></div> <div id="city"><? echo $data['city']; ?></div> <div id="comments"><? echo $data['landlord_comments']; ?></div> </tr> </table> <? } //End While ?>
  8. Hi. I have a rating site where users fill in a name of what they are rating, comments about it and a rating and submit it to my database. I then have another page which shows all of these entries but only the name and overall rating using php. What I want is for users to click on the name and it take them to a separate page which displays all the comments and ratings for that item. As users can add items to rate I cant set up a page for each manually so was wondering how to do it dynamically. Everything i throw into google leads me in the wrong direction though. If someone could point me to a good tutorial or give me an idea about what to search id be very grateful. Cheers.
  9. Thanks so much everybody for your help it worked!!
  10. Hi. I have the following code where I grab the names and average overall rating from my database and group by the name. $sql="SELECT name, AVG(overall) AS overall FROM $tbl_name GROUP BY name ORDER BY AVG(overall) DESC"; $result=mysql_query($sql); while($rows=mysql_fetch_array($result)){ Does anybody know how I can count the number of names that have been grouped together? For instance: Name Overal ratingl John 2 Pete 5 John 8 It should group the john's, calculate the average rating (8+2)/2=5, and then show that there have been 2 johns making up the 5 rating? I've tried using the code below and messed around with it loads but cant get it to work: $sql="SELECT name, AVG(overall) AS overall FROM $tbl_name COUNT name GROUP BY name ORDER BY AVG(overall) DESC"; $result=mysql_query($sql); while($rows=mysql_fetch_array($result)){ echo $rows['Count name']; Thanks in advance.
  11. That was it. Works like a treat. Thank you so much for all your help!!
  12. Managed to work it out. I had checked= $variable in the form so instead replaced the whole thing with echo $variable. Thanks a lot!! Got the problem now in that it checks the buttons regardless of landlord name i.e: NAME Value Bob 2 John 4 It would check both the 2nd and 4th radio buttons. Anyone know how to make it only check the value that corresponds to the name?? Thanks
  13. Thank you it has stopped throwing that error at me however now it seems as though it is always saying that 5 is checked (or possibly all of them checked) regardless of the value. I looked in my database and the overall value is 1 yet it checks number 5. Any ideas? Thanks for your help so far.
  14. Thanks for the reply however it is giving me an error of: Fatal error: Call to undefined function AVG() in /srv/disk2/959619/www/studentlandlordreviews.co.uk/landlord-reviews.php on line 58 which refers to the: if (AVG(overall)==1){ I guess this means it doesnt know what AVG(overall) is so i tried this instead but still no luck: $avg =AVG(overall); if ($avg==1){ $check1='checked="checked"';} Thanks for your help.
  15. Hi. Im pretty sure this is easy but ive been trying for hours and looked all over the web but cant seem to do it. I have information submitted to my database which I then retrieve on another page. I retrieve the landlord name and group the same values together plus retrieve an overall rating which I average and sort by. This works and is done using: $sql="SELECT landlord_name, AVG(overall) FROM $tbl_name GROUP BY landlord_name ORDER BY AVG(overall) DESC"; $result=mysql_query($sql); // Start looping rows in mysql database. while($rows=mysql_fetch_array($result)){ Where Im finding it difficult though is I have 5 radio buttons with values from 1-5 and want one of them to be checked if the value matches the averaged overall rating. What I've tried is: if (AVG(overall)==1){ $check1="checked";} if (AVG(overall)==2){ $check2="checked";} if (AVG(overall)==3){ $check3="checked";} if (AVG(overall)==4){ $check4="checked";} if (AVG(overall)==5){ $check5="checked";} then in the form: <table width="600" border="1" cellspacing="0" cellpadding="3"> <tr> <td><? echo $rows['landlord_name']; ?></td> <td><div class="avg"><form> <input type="radio" value="1" disabled="disabled" checked= "<? $check1 ?>" /> <input type="radio" value="2" disabled="disabled" checked= "<? $check2 ?>" /> <input type="radio" value="3" disabled="disabled" checked= "<? $check3 ?>" /> <input type="radio" value="4" disabled="disabled" checked= "<? $check4 ?>" /> <input type="radio" value="5" disabled="disabled" checked= "<? $check5 ?>"/> </form></div> </td> </tr> </table> To make it a bit more difficult, the AVG(overall) value will not always be an integer from 1-5 and will need to be rounded to the closest one. Think i can use ROUND for this but dont know how to put it in. Thanks for your help in advance. As you can probably tell im new to php and still learning the basics.
  16. http://gamesigs.co.uk 1) Is the Design ok? 2) How can i attract more visitors? Also This is the actual generator on my site http://gamesigs.co.uk/games.htm or click on link from homepage 1) what is the loading speed like? the frame is slow mine, 2)how can i speed it up? 3) how can i make it user friendly or better in any way? Thanks a lot i appreciate it.
  17. ok i have had an attempt but it aint worked. can you tell me why? <?php $user="joshuacottom_db"; $password=" "; $database="joshuacottom_db"; $color=$_POST['color']; $name=$_POST['name']; $centre=$_POST['centre']; $size=$_POST['size']; $x=$_POST['x']; $y=$_POST['y']; $angle=$_POST['angle']; $font=$_POST['font']; $color_r=$_POST['color_r']; $color_g=$_POST['color_g']; $color_b=$_POST['color_b']; mysql_connect('db4.awardspace.com','joshuacottom_db',' '; @mysql_select_db($database) or die( "Unable to select database"); $query = "INSERT INTO sig VALUES ('','color','$name','$centre','$size','$x','$y','$angle','$font','','$color_r','$color_g','$color_b')"; mysql_query($query); mysql_close(); //End of database stuff header("Content-type: image/jpeg"); $name = stripslashes($_GET['name']); $size = stripslashes($_GET['size']); $centre = stripslashes($_GET['centre']); $font = 'images/sig_maker/fonts/'.stripslashes($_GET['font']).'.ttf'; $fontcolor['r'] = stripslashes($_GET['color_r']); // font color - RED $fontcolor['g'] = stripslashes($_GET['color_g']); // font color - GREEN $fontcolor['b'] = stripslashes($_GET['color_b']); // font color - BLUE $lines = stripslashes($_GET['lines']); function arrow($im, $x1, $y1, $x2, $y2, $alength, $awidth, $color){ /// } if(is_numeric($_GET['color']) && $_GET['color'] >= '1' && $_GET['color'] <= '54') { $bgpic = 'images/sig_maker/' . $_GET['color'] . '.jpeg'; } $im = imagecreatefromjpeg($bgpic); //Calculate, the centre: for(;{ list($image_width, $image_height) = getimagesize($bgpic); list($left_x, , $right_x) = imagettfbbox($size, 0, $font, $name); $text_width = $right_x - $left_x; if($image_width > $text_width+5){ break; } $size = $size - .5; if($size == 1){ die('Script not responding to decreasing font size, in other words: try using less letters.'); } } $hpadding = ($image_width - $text_width)/2; $vpadding = ($image_height/2); $textcolor = imagecolorresolve($im, $fontcolor['r'], $fontcolor['g'], $fontcolor['b']); if($centre== 'y'){ imagettftext($im, $size, 0, $hpadding,$vpadding, $textcolor, $font, $name); }else{ imagettftext($im, $size, $angle, $x, $y, $textcolor, $font, $name); } imagegif($im); imagedestroy($im); //show info $username="joshuacottom_db"; $password=" "; $database="joshuacottom_db"; mysql_connect('db4.awardspace.com','joshuacottom_db',' '); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM sig"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); echo "<b><center>Last Signature</center></b><br><br>"; $i=0; while ($i < $num) { ?> <imgsrc="http://gamesigs.co.uk/testcreation.php?<? echo" $color=mysql_result($result,$i,"color");&$name=mysql_result($result,$i,"name");&$centre=mysql_result($result,$i,"centre");&$size=mysql_result($result,$i,"size");&$x=mysql_result($result,$i,"x");&$y=mysql_result($result,$i,"y");&$angle=mysql_result($result,$i,"angle");&$font=mysql_result($result,$i,"font");&$color_r=mysql_result($result,$i,"color_r");&$color_g=mysql_result($result,$i,"color_g");&$color_b=mysql_result($result,$i,"color_b")";?>" alt="the last sig created" <? $i++; } mysql_close(); ?>
  18. Hi I have a script that lets users pick an image and add text to it using this php script: <?php header("Content-type: image/jpeg"); $name = stripslashes($_GET['name']); $size = stripslashes($_GET['size']); $centre = stripslashes($_GET['centre']); $font = 'images/sig_maker/fonts/'.stripslashes($_GET['font']).'.ttf'; $fontcolor['r'] = stripslashes($_GET['color_r']); // font color - RED $fontcolor['g'] = stripslashes($_GET['color_g']); // font color - GREEN $fontcolor['b'] = stripslashes($_GET['color_b']); // font color - BLUE $lines = stripslashes($_GET['lines']); function arrow($im, $x1, $y1, $x2, $y2, $alength, $awidth, $color){ /// } if(is_numeric($_GET['color']) && $_GET['color'] >= '1' && $_GET['color'] <= '54') { $bgpic = 'images/sig_maker/' . $_GET['color'] . '.jpeg'; } $im = imagecreatefromjpeg($bgpic); //Calculate, the centre: for(;{ list($image_width, $image_height) = getimagesize($bgpic); list($left_x, , $right_x) = imagettfbbox($size, 0, $font, $name); $text_width = $right_x - $left_x; if($image_width > $text_width+5){ break; } $size = $size - .5; if($size == 1){ die('Script not responding to decreasing font size, in other words: try using less letters.'); } } $hpadding = ($image_width - $text_width)/2; $vpadding = ($image_height/2); $textcolor = imagecolorresolve($im, $fontcolor['r'], $fontcolor['g'], $fontcolor['b']); if($centre== 'y'){ imagettftext($im, $size, 0, $hpadding,$vpadding, $textcolor, $font, $name); }else{ imagettftext($im, $size, $angle, $x, $y, $textcolor, $font, $name); } imagegif($im); imagedestroy($im); ?> This works fine, however I want to automatically save each image that is created to a Mysql table and show the last 5 images created. I dont want to keep the images stored in the Mysql forever, just until 5 new sigs have been created. I have very basic knowledge of php and no knowledge of Mysql except a few tutorials i have read. So far i have created a table called sig and have fields in it that the image uses (i.e. $name, $font, $size etc and an ID field with increment set to 0??? and also primary?) I did this because when you create an image the url looks like this... http://gamesigs.co.uk/testgenerator.php?color=25&name=your+text+here&centre=y&x=2&y=30&angle=0&font=unreal&size=25&select=255%2C255%2C255&color_r=255&color_g=255&color_b=255&submit=Create+My+Sig%21 and i thought if i could save these variables when a user submits the form it could work. Any way I'm completely clueless By the way if you want to see my site here's the address: www.gamesigs.co.uk PLEASE HELP!!! Digi.
  19. no that new code didnt work ??? Any other ideas? p.s how do i print out the $_GET['link'] ??? i am a novice at best
  20. no sorry it didnt work, here is the full code: for the html form: <form method="get" action="http://gamesigs.co.uk/testcreation.php" name="form" onsubmit="return checkit(this);"> <input name="link" type="checkbox" id="link" value="y" checked /> check to use address <input type="text" name="useraddress" id="useraddress" value="" style="width:117px;" /> for the php creation file: <?php header("Content-type: image/jpeg"); $name = stripslashes($_GET['name']); $size = stripslashes($_GET['size']); $centre = stripslashes($_GET['centre']); $font = 'images/sig_maker/fonts/'.stripslashes($_GET['font']).'.ttf'; $fontcolor['r'] = stripslashes($_GET['color_r']); // font color - RED $fontcolor['g'] = stripslashes($_GET['color_g']); // font color - GREEN $fontcolor['b'] = stripslashes($_GET['color_b']); // font color - BLUE $lines = stripslashes($_GET['lines']); function arrow($im, $x1, $y1, $x2, $y2, $alength, $awidth, $color){ /// } if(is_numeric($_GET['color']) && $_GET['color'] >= '1' && $_GET['color'] <= '54') { $bgpic = 'images/sig_maker/' . $_GET['color'] . '.jpeg'; } if($_POST['link']== 'y'){ $im = imagecreatefromjpeg($useraddress); }else{ $im = imagecreatefromjpeg($im); } //Calculate, the centre: for(;{ list($image_width, $image_height) = getimagesize($bgpic); list($left_x, , $right_x) = imagettfbbox($size, 0, $font, $name); $text_width = $right_x - $left_x; if($image_width > $text_width+5){ break; } $size = $size - .5; if($size == 1){ die('Script not responding to decreasing font size, in other words: try using less letters.'); } } $hpadding = ($image_width - $text_width)/2; $vpadding = ($image_height/2); $textcolor = imagecolorresolve($im, $fontcolor['r'], $fontcolor['g'], $fontcolor['b']); if($centre== 'y'){ imagettftext($im, $size, 0, $hpadding,$vpadding, $textcolor, $font, $name); }else{ imagettftext($im, $size, $angle, $x, $y, $textcolor, $font, $name); } imagegif($im); imagedestroy($im); ?> MOD EDIT: digi_duck, use <?php ... ?> tags
  21. Hi I want users to be able to create an image from either an image template on my site (labelled $im) or by entering in a url.I think i've worked it out, but my php is not very good so can you tell me where i'm going wrong with it please? I realised that the $im = imagecreatefromjpeg($im) doesn't have to point to a variable, it can also point to a url i.e $im = imagecreatefromjpeg(http://www.address.com/image.jpeg) YEY- This works, however when i try adding a tick box to the html form that the user checks when they want to specify an address i get the url coming up instead of the image. This is the code that i have put in the php file... if($link== 'y'){ $im = imagecreatefromjpeg($useraddress); }else{ $im = imagecreatefromjpeg($im); } The checkbox is called link and the textbox for the address is called useraddress. If you want to see for yourself what its doing go to www.gamesigs.co.uk/test.php Cheers and i hope to hear from you soon.
  22. i've tried I managed to make the centre option from scratch by my self but i cant get the tag line to show up. Its the if else statements i cant handle i think.
  23. ye sure: sorry This is the form that you enter the text in and pick your pictures... <form method="get" action="http://gamesigs.co.uk/testgenerator.php" name="form" id="form" onsubmit="return checkit(this);"> <div align="center"> <p align="center"> </p> <p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Step #1:</strong> <span class="style1">Choose a sig.</span></font> </p> </div> <table width="550" border="0" cellspacing="0" cellpadding="0"> <!--DWLayoutTable--> <tr> <td height="6"></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <!--DWLayoutTable--> <tr> <td height="116" colspan="4" align="center" valign="top"><a href="http://i62.photobucket.com/albums/h109/gamesignatures/28.jpg"><img src="images/sig_maker/28.jpeg" alt="Click to see full size." width="270" height="90" border="0"></a><br> <input name="color" type="radio" id="color" value="28" checked></td> <td colspan="3" align="center" valign="top"> <p><a href="http://i62.photobucket.com/albums/h109/gamesignatures/29.jpg"><img src="images/sig_maker/29.jpeg" alt="Click to see full size." width="270" height="90" border="0"></a><br> <input name="color" type="radio" id="color" value="29"> </p></td> </tr> <tr> <td height="116" colspan="4" align="center" valign="top"> <p><a href="http://i62.photobucket.com/albums/h109/gamesignatures/35.jpg"><img src="images/sig_maker/35.jpeg" alt="Click to see full size." width="270" height="90" border="0"></a> <input name="color" type="radio" id="radio" value="35"> </p></td> <td colspan="3" align="center" valign="top"> <p><a href="http://i62.photobucket.com/albums/h109/gamesignatures/36.jpg"><img src="images/sig_maker/36.jpeg" alt="Click to see full size." width="270" height="90" border="0"></a> <input name="color" type="radio" id="radio2" value="36"> </p></td> </tr> <tr> <td height="116" colspan="4" align="center" valign="top"><a href="http://i62.photobucket.com/albums/h109/gamesignatures/41.jpg"><img src="images/sig_maker/41.jpeg" alt="Click to see full size." width="270" height="90" border="0"></a> <input name="color" type="radio" id="radio3" value="41"></td> <td colspan="3" align="center" valign="top"><a href="http://i62.photobucket.com/albums/h109/gamesignatures/44.jpg"><img src="images/sig_maker/44.jpeg" alt="Click to see full size." width="270" height="90" border="0"></a> <input name="color" type="radio" id="radio4" value="44"></td> </tr> <tr> <td height="116" colspan="4" align="center" valign="top"><a href="http://i62.photobucket.com/albums/h109/gamesignatures/45.jpg"><img src="images/sig_maker/45.jpeg" alt="Click to see full size." width="270" height="90" border="0"></a> <input name="color" type="radio" id="radio5" value="45"></td> <td colspan="3" align="center" valign="top"><!--DWLayoutEmptyCell--> </td> </tr> <tr> <td width="182" rowspan="11" align="center" valign="top"><!--DWLayoutEmptyCell--> </td> <td height="35" colspan="5" align="center" valign="middle"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Step #2:</strong> <span class="style1">Configure the text.</span></font></td> <td width="179" rowspan="11" align="center" valign="middle"> <p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"></font></p> <p align="left"> </p> <p align="left"> </p> <p align="left"><font size="1"> </font></p> <p align="left"> </p> <p align="left"> </p> <p align="left"> </p> <p align="left"> </p> <p align="left"> </p> <p align="center"> </p> <p align="center"> </p></td> </tr> <tr align="center" valign="middle"> <td height="25" colspan="2" valign="middle"><div align="left">Your text:</div></td> <td colspan="3" align="left"> <input type="text" name="name" id="name7" value="" style="width:117px;" /></td> </tr> <tr align="center" valign="middle"> <td height="25" colspan="2" valign="middle"> <p align="left">Centre The Text: </p></td> <td colspan="3" valign="middle"> <div align="left"> <input name="centre" type="checkbox" id="centre9" value="y" checked /> <font size="1"> (disables positioning)</font></div></td> </tr> <tr align="center" valign="middle"> <td height="25" colspan="2" valign="middle"><div align="left"><font size="1">X coordinates </font></div></td> <td colspan="3"> <div align="left"><font size="1"> <input type="text" name="x" id="x7" value="75" style="width:117px;" /> </font></div></td> </tr> <tr align="center" valign="middle"> <td height="25" colspan="2" valign="middle"><div align="left">y coordinates </div></td> <td colspan="3"> <div align="left"> <input type="text" name="y" id="y6" value="200" style="width:117px;" /> </div></td> </tr> <tr align="center" valign="middle"> <td height="25" colspan="2" valign="middle"> <div align="left">Angle</div></td> <td colspan="3"> <div align="left"> <input type="text" name="angle" id="angle5" value="0" style="width:117px;" /> </div></td> </tr> <tr align="center" valign="middle"> <td height="25" colspan="2"><div align="left">Pick A Font:</div></td> <td colspan="3"> <div align="left"> <select name="font" onChange="update_font(this.options[selectedIndex].value);"> <option value="28DaysLater"selected="selected">28 Days Later</option> <option value="alladin">Alladin</option> <option value="backslash">Backslash</option> <option value="blade 2">Blade 2</option> <option value="cafe">Cafe</option> <option value="camo" >Camo</option> <option value="curvy">Curvy</option> <option value="daredevil">Daredevil</option> <option value="dodger">Dodger</option> <option value="Elektra">Elektra</option> <option value="espionage">Espionage</option> <option value="farcry">Farcry</option> <option value="fatboyslim">Fatboy Slim</option> <option value="hippy">Hippy</option> <option value="jaws">Jaws</option> <option value="metalgearsolid">Metal Gear</option> <option value="metalgearsolid2">Metal Gear 2</option> <option value="residentevil">Resident Evil</option> <option value="satanic">Satanic</option> <option value="sega">SEGA</option> <option value="shadow">Shadow</option> <option value="slash">Slash</option> <option value="sponge">Sponge</option> <option value="starsky">Starsky</option> <option value="strokes">Strokes</option> <option value="tech9">Tech 9</option> <option value="terrorvision">Terrorvision</option> <option value="godfather">Godfather</option> <option value="trek">Trek</option> <option value="underground">Underground</option> <option value="unreal">Unreal</option> </select> </div></td> </tr> <tr align="center" valign="middle"> <td height="25" colspan="2"><div align="left">Pick A Font Size:</div></td> <td colspan="3"> <div align="left"> <select name="size"> <option value="4">4px</option> <option value="5">5px</option> <option value="6">6px</option> <option value="7">7px</option> <option value="8">8px</option> <option value="9">9px</option> <option value="10">10px</option> <option value="11">11px</option> <option value="12">12px</option> <option value="13">13px</option> <option value="14">14px</option> <option value="15">15px</option> <option value="16">16px</option> <option value="17">17px</option> <option value="18">18px</option> <option value="19">19px</option> <option value="20">20px</option> <option value="21">21px</option> <option value="22">22px</option> <option value="23">23px</option> <option value="24">24px</option> <option value="25"selected="selected">25px</option> <option value="26">26px</option> <option value="27">27px</option> <option value="28">28px</option> <option value="29">29px</option> <option value="30">30px</option> <option value="31">31px</option> <option value="32">32px</option> <option value="33">33px</option> <option value="34">34px</option> <option value="35">35px</option> <option value="36">36px</option> <option value="37">37px</option> <option value="38">38px</option> <option value="39">39px</option> <option value="40">40px</option> <option value="41">41px</option> <option value="42">42px</option> <option value="43">43px</option> <option value="44">44px</option> <option value="45">45px</option> </select> </div></td> </tr> <tr align="center" valign="middle"> <td height="25" colspan="2"><div align="left">Font Color: </div></td> <td colspan="3"> <div align="left"> <select name="select" onChange="colorvalues(this)"> <option style="background:#F0F8FF;" value="240,248,255">aliceblue</option> <option style="background:#FAEBD7;" value="250,235,215">antique white</option> <option style="background:#00FFFF;" value="0,255,255">aqua</option> <option style="background:#7FFFD4;" value="127,255,212">aquamarine</option> <option style="background:#F0FFFF;" value="240,255,255">azure</option> <option style="background:#F5F5DC;" value="245,245,220">beige</option> <option style="background:#FFE4C4;" value="255,228,196">bisque</option> <option style="background:#000000;" value="0,0,0">black</option> <option style="background:#FFEBCD;" value="255,235,205">blanchedalmond</option> <option style="background:#0000FF;" value="0,0,255">blue</option> <option style="background:#8A2BE2;" value="138,43,226">blueviolet</option> <option style="background:#A52A2A;" value="165,42,42">brown</option> <option style="background:#DEB887;" value="222,184,135">burlywood</option> <option style="background:#5F9EA0;" value="95,158,160">cadetblue</option> <option style="background:#7FFF00;" value="127,255,0">charteuse</option> <option style="background:#D2691E;" value="210,105,30">chocolate</option> <option style="background:#FF7F50;" value="255,127,80">coral</option> <option style="background:#6495ED;" value="90,149,237">cornflowerblue</option> <option style="background:#FFF8DC;" value="255,248,220">cornsilk</option> <option style="background:#DC143C;" value="220,20,60">crimson</option> <option style="background:#00FFFF;" value="0,255,255">cyan</option> <option style="background:#00008B;" value="0,0,139">darkblue</option> <option style="background:#008B8B;" value="0,139,139">darkcyan</option> <option style="background:#B8860B;" value="184,134,11">darkgoldenrod</option> <option style="background:#A9A9A9;" value="169,169,169">darkgray</option> <option style="background:#006400;" value="0,100,0">darkgreen</option> <option style="background:#BDB76B;" value="189,183,107">darkkhaki</option> <option style="background:#8B008B;" value="139,0,139">darkmagenta</option> <option style="background:#556B2F;" value="85,107,47">darkolivegreen</option> <option style="background:#FF8C00;" value="255,140,0">darkorange</option> <option style="background:#9932CC;" value="153,50,204">darkorchid</option> <option style="background:#8B0000;" value="139,0,0">darkred</option> <option style="background:#E9967A;" value="233,150,122">darksalmon</option> <option style="background:#8FBC8F;" value="143,188,143">darkseagreen</option> <option style="background:#483D8B;" value="72,61,139">darkslateblue</option> <option style="background:#2F4F4F;" value="47,79,79">darkslategray</option> <option style="background:#00CED1;" value="0,206,209">darkturquoise</option> <option style="background:#9400D3;" value="148,0,211">darkviolet</option> <option style="background:#FF1493;" value="255,20,147">deeppink</option> <option style="background:#00BFFF;" value="0,191,255">deepskyblue</option> <option style="background:#696969;" value="105,105,105">dimgray</option> <option style="background:#1E90FF;" value="30,144,255">dodgerblue</option> <option style="background:#B22222;" value="178,34,34">firebrick</option> <option style="background:#FFFAF0;" value="255,250,240">floralwhite</option> <option style="background:#228B22;" value="34,139,34">forestgreen</option> <option style="background:#FF00FF;" value="255,0,255">fuchsia</option> <option style="background:#DCDCDC;" value="220,220,220">gainsboro</option> <option style="background:#F8F8FF;" value="248,248,255">ghostwhite</option> <option style="background:#FFD700;" value="255,215,0">gold</option> <option style="background:#DAA520;" value="218,165,32">goldenrod</option> <option style="background:#808080;" value="128,128,128">gray</option> <option style="background:#008000;" value="0,128,0">green</option> <option style="background:#ADFF2F;" value="173,255,47">greenyellow</option> <option style="background:#F0FFF0;" value="240,255,240">honeydew</option> <option style="background:#FF69B4;" value="255,105,180">hotpink</option> <option style="background:#CD5C5C;" value="205,92,92">indianred</option> <option style="background:#4B0082;" value="75,0,130">indigo</option> <option style="background:#FFFFF0;" value="255,255,240">ivory</option> <option style="background:#F0E68C;" value="240,230,140">khaki</option> <option style="background:#E6E6FA;" value="230,230,250">lavender</option> <option style="background:#FFF0F5;" value="255,240,245">lavenderblush</option> <option style="background:#7CFC00;" value="124,252,0">lawngreen</option> <option style="background:#FFFACD;" value="255,250,205">lemonchiffon</option> <option style="background:#ADD8E6;" value="173,216,230">lightblue</option> <option style="background:#F08080;" value="240,128,128">lightcoral</option> <option style="background:#E0FFFF;" value="224,255,255">lightcyan</option> <option style="background:#FAFAD2;" value="250,250,210">lightgoldenrodyellow</option> <option style="background:#90EE90;" value="144,238,144">lightgreen</option> <option style="background:#D3D3D3;" value="211,211,211">lightgrey</option> <option style="background:#FFB6C1;" value="255,182,193">lightpink</option> <option style="background:#FFA07A;" value="255,160,122">lightsalmon</option> <option style="background:#20B2AA;" value="32,178,170">lightseagreen</option> <option style="background:#87CEFA;" value="135,205,250">lightskyblue</option> <option style="background:#778899;" value="119,136,153">lightslategray</option> <option style="background:#B0C4DE;" value="176,196,222">lightsteelblue</option> <option style="background:#FFFFE0;" value="255,255,224">lightyellow</option> <option style="background:#00FF00;" value="0,255,0">lime</option> <option style="background:#32CD32;" value="50,205,50">limegreen</option> <option style="background:#FAF0E6;" value="135,240,230">linen</option> <option style="background:#FF00FF;" value="255,0,255">magenta</option> <option style="background:#800000;" value="128,0,0">maroon</option> <option style="background:#66CDAA;" value="102,205,170">mediumaquamarine</option> <option style="background:#0000CD;" value="0,0,205">mediumblue</option> <option style="background:#BA55D3;" value="186,85,211">mediumorchid</option> <option style="background:#9370DB;" value="147,112,219">mediumpurple</option> <option style="background:#3CB371;" value="60,179,113">mediumseagreen</option> <option style="background:#7B68EE;" value="123,104,238">mediumslateblue</option> <option style="background:#00FA9A;" value="0,135,154">mediumspringgreen</option> <option style="background:#48D1CC;" value="72,209,204">mediumturquoise</option> <option style="background:#C71585;" value="199,21,133">mediumvioletred</option> <option style="background:#191970;" value="25,25,112">midnightblue</option> <option style="background:#F5FFFA;" value="245,255,135">mintcream</option> <option style="background:#FFE4E1;" value="255,228,225">mistyrose</option> <option style="background:#FFDEAD;" value="255,222,173">navajowhite</option> <option style="background:#000080;" value="0,0,128">navy</option> <option style="background:#FDF5E6;" value="153,245,246">oldlace</option> <option style="background:#808000;" value="128,128,0">olive</option> <option style="background:#6B8E23;" value="107,142,35">olivedrab</option> <option style="background:#FFA500;" value="255,165,0">orange</option> <option style="background:#FF4500;" value="255,69,0">orangered</option> <option style="background:#DA70D6;" value="218,112,214">orchid</option> <option style="background:#EEE8AA;" value="238,232,170">palegoldenrod</option> <option style="background:#98FB98;" value="152,251,152">palegreen</option> <option style="background:#AFEEEE;" value="175,138,138">paleturquoise</option> <option style="background:#DB7093;" value="219,112,147">palevioletred</option> <option style="background:#FFEFD5;" value="255,239,213">papaawhip</option> <option style="background:#FFDAB9;" value="255,218,185">peachpuff</option> <option style="background:#CD853F;" value="205,133,63">peru</option> <option style="background:#FFC0CB;" value="255,192,203">pink</option> <option style="background:#DDA0DD;" value="221,160,221">plum</option> <option style="background:#B0E0E6;" value="176,224,230">powderblue</option> <option style="background:#800080;" value="128,0,128">purple</option> <option style="background:#FF0000;" value="255,0,0">red</option> <option style="background:#BC8F8F;" value="188,143,143">rosybrown</option> <option style="background:#4169E1;" value="65,105,225">royalblue</option> <option style="background:#8B4513;" value="139,69,19">saddlebrown</option> <option style="background:#FA8072;" value="135,128,114">salmon</option> <option style="background:#F4A460;" value="244,164,96">sandybrown</option> <option style="background:#2E8B57;" value="46,139,87">seagreen</option> <option style="background:#FFF5EE;" value="255,245,238">seashell</option> <option style="background:#A0522D;" value="160,82,45">sienna</option> <option style="background:#C0C0C0;" value="192,192,192">silver</option> <option style="background:#87CEEB;" value="135,206,235">skyblue</option> <option style="background:#6A5ACD;" value="106,90,205">slateblue</option> <option style="background:#FFFAFA;" value="255,250,250">snow</option> <option style="background:#00FF7F;" value="0,255,127">springgreen</option> <option style="background:#4682B4;" value="70,130,180">steelblue</option> <option style="background:#D2B48C;" value="210,180,140">tan</option> <option style="background:#008080;" value="0,128,128">teal</option> <option style="background:#D8BFD8;" value="216,191,216">thistle</option> <option style="background:#FF6347;" value="255,99,71">tomato</option> <option style="background:#40E0D0;" value="64,224,208">turquoise</option> <option style="background:#EE82EE;" value="238,130,238">violet</option> <option style="background:#F5DEB3;" value="245,222,179">wheat</option> <option style="background:#FFFFFF;" value="255,255,255" selected="selected">white</option> <option style="background:#F5F5F5;" value="245,245,245">whitesmoke</option> <option style="background:#FFFF00;" value="255,255,0">yellow</option> <option style="background:#9ACD32;" value="154,205,50">yellowgreen</option> </select> </div></td> </tr> <tr align="center" valign="middle"> <td width="80" height="27">Red: <input type="text" name="color_r" value="255" style="width:25px;" maxlength="3" /></td> <td colspan="3">Green: <input type="text" name="color_g" value="255" style="width:25px;" maxlength="3" /></td> <td width="79">Blue: <input type="text" name="color_b" value="255" style="width:25px;" maxlength="3" /></td> </tr> <tr align="center" valign="middle"> <td height="114" colspan="5" valign="top"><p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Step #3:</strong> <span class="style1">Click on the button.</span></font></p> <p align="center"> <input name="submit" type="submit" class="sub" id="submit5" value="Create My Sig!" /> </p> <p align="center"><a href="http://gamesigs.co.uk/phpBB2/viewtopic.php?p=35#35">Thankyou to all those who have generously donated us their artwork. All credit goes to them.</a></p> <p align="center"> </p></td> </tr> <tr> <td height="1"></td> <td></td> <td width="25"></td> <td width="13"></td> <td width="42"></td> <td></td> <td></td> </tr> </table></form> and this is the file the data gets sent to. <?php header("Content-type: image/jpeg"); $name = stripslashes($_GET['name']); $size = stripslashes($_GET['size']); $centre = stripslashes($_GET['centre']); $font = 'images/sig_maker/fonts/'.stripslashes($_GET['font']).'.ttf'; $fontcolor['r'] = stripslashes($_GET['color_r']); // font color - RED $fontcolor['g'] = stripslashes($_GET['color_g']); // font color - GREEN $fontcolor['b'] = stripslashes($_GET['color_b']); // font color - BLUE $lines = stripslashes($_GET['lines']); function arrow($im, $x1, $y1, $x2, $y2, $alength, $awidth, $color){ /// } if(is_numeric($_GET['color']) && $_GET['color'] >= '1' && $_GET['color'] <= '54') { $bgpic = 'images/sig_maker/' . $_GET['color'] . '.jpeg'; } $im = imagecreatefromjpeg($bgpic); //Calculate, the centre: for(;{ list($image_width, $image_height) = getimagesize($bgpic); list($left_x, , $right_x) = imagettfbbox($size, 0, $font, $name); $text_width = $right_x - $left_x; if($image_width > $text_width+5){ break; } $size = $size - .5; if($size == 1){ die('Script not responding to decreasing font size, in other words: try using less letters.'); } } $hpadding = ($image_width - $text_width)/2; $vpadding = ($image_height/2); $textcolor = imagecolorresolve($im, $fontcolor['r'], $fontcolor['g'], $fontcolor['b']); if($centre== 'y'){ imagettftext($im, $size, 0, $hpadding,$vpadding, $textcolor, $font, $name); }else{ imagettftext($im, $size, $angle, $x, $y, $textcolor, $font, $name); } imagegif($im); imagedestroy($im); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.