Jump to content

Mateobus

Members
  • Posts

    95
  • Joined

  • Last visited

    Never

Everything posted by Mateobus

  1. I am using a script that creates image thumbnails on the fly.  The script that i found relies on the function imagecreatetruecolor().  When i run this script i get the following error: Fatal error: Call to undefined function: imagecreatetruecolor().  I take it that my version of php does not have this function.  Is there a way that I can still use this script.  Is there a way i could just copy the necesary functions and include them in a separate file...  Any help is much appreciated.
  2. I am currently building an image upload section on my website. I was wondering if there is a free script, application, or tutorial of some sort that will automatically thumbnail an image when it is uploaded.  Even if its not coded in php.  Any Feedback is greatly appreciated thanks.
  3. I am trying to write a php function that validates a username and password. To keep things simple i want to allow only letters and numbers upper and lower case allowed.  Is there a good function for this?
  4. Thanks for the script, but it isn't working.  I actually tried this one before with no success.  I think that it is a new security feature built in to ie that is stopping the preview from working.  Is this correct?  I think the only way to do it would be to make a whole java applet.  Any suggestions? Tested in IE7 beta 1 and firefox 1.5.0.4
  5. Hello, I have an image upload page on my website, but I want to make it so that a person can preview the image on their computer before they upload it.  Is this possible with javascript?  Does anyone know of a good tutorial for this? Any help is appreciated.
  6. I am trying to connect to a different database that isnt on localhost.  How do i do that? $hostname= "www.othersite.com"; $database= "database"; $username= "username"; $password= "password"; $db = mysql_connect($hostname, $username, $password) or die(mysql_error()); is this right?
  7. I am trying to add 7 days to a date, is there a way to do this with the date function, or in a MySQL query with a date column. 
  8. Interesting...Several page refreshes say that option 2 takes longer. Option 1 : 0.0028409957885742 Option 2 : 0.0035510063171387 Option 1 : 0.0027570724487305 Option 2 : 0.0030298233032227 Option 1 : 0.0025520324707031 Option 2 : 0.0031177997589111 thanks for the timer code, looks like i go the faster server barand!
  9. Hey all, I have a speed question, here are two code snippets, which will run faster? ---------------------------- Code -------------------------------- // This is Option 1 <html> Name:<?php echo $Name; ?> <br /> School:<?php echo $school; ?> <br /> </html> ----------------------------End Code ---------------------------- ---------------------------- Code -------------------------------- // This is Option 2 <html> <?php echo “Name: $Name <br />”. “School: $School <br />”; ?> </html> ----------------------------End Code --------------------------- This is a very simplified version of the issue i am dealing with. For example, if I am writing complicated html code that creates tables, should I write that using a php echo statement, or use html and make several php calls for each piece of data... Hope you understand the question that I am asking. Thanks
  10. Ok I want to take a long string that is 100's of words and make a new string from it that is the first 15 words of that string. Is there an existing function that does this, if so it would look like this. $string = "Hello my name is joe and I am great"; $smallstring = function($string, 3); echo $smallstring; Displays: Hello my name
  11. I just want to do a Boolean check of a string that returns true if the last two characters of the string are upper case and false otherwise. Thanks.
  12. Ok, I have made progress, but I didn't quite get it yet using your method, I have changed things a bit the biggest thing to note is that it is all on one page: <body> <form name="frame1" method="POST" action="this_same_page"> <input type="hidden" id="vartodel" name="vartodel" > </form> <script type="text/javascript"> function confirmation(id) { var answer = confirm("Delete Game "+id+"?") if (answer){ document.getElementById('vartodel').value=id; document.frame1.submit(); } } </script> //If delete has been pressed if (A CHECK TO SEE IF FRAME1 has been submitted){ // THIS LINE I CANT FIGURE OUT $vartodel=$_POST['vartodel']; $thesql = "DELETE FROM table WHERE id='$vartodel' LIMIT 1"; if(mysql_query($thesql)) echo "<font color=\"red\"> Deleted</font><br />"; } $id = 6; <a href="this_page" onclick="confirmation('$id')">Delete</a> Someone let me know if this will work all on one page like so.
  13. OK, I am trying to use php and javascript together and I have made more progress than I thought originally. The idea is that I want to have a delete option for some data in my mySQL database. IF the user clicks the delete link, it passes the ID to the confirmation(id) function. I have this working. Now I want to make the query that uses that ID, not as easy. Here is the code I have, anyone got the rest... function confirmation(id) { var answer = confirm("Delete data: "+id+"?") if (answer){ <?php $sql = "DELETE FROM table WHERE id='"; ?> //I want to say ID here... } }
  14. AJAX, i don't even know what that is... There has to be an easier way.
  15. OK, I am trying to use php and javascript together and I have made more progress than I thought originally. The idea is that I want to have a delete option for some data in my mySQL database. IF the user clicks the delete link, it passes the ID to the confirmation(id) function. I have this working. Now I want to make the query that uses that ID, not as easy. Here is the code I have, anyone got the rest... function confirmation(id) { var answer = confirm("Delete data: "+id+"?") if (answer){ <?php $sql = "DELETE FROM table WHERE id='"; ?> //I want to say ID here... } }
  16. OK, i have a mySQL table with date elements in the format YYYY-MM-DD. How do I display these dates nicely in PHP Like: Month Day, Year, or just Month, Day I looked for a couple tutorials but didn't find much. I feel like there should be a really simple way to do this.
  17. A select box with 300 options seems like too many.
  18. Ok, here is the issue, and it might require javascript which i am not very familiar with. I have a form and one of the input boxes is for a school code based on a list of schools. Since there is no way of knowing the school code, they have to click on the lookup code which opens a pop-up window. I want to make this page work so that when they click on the school code, it automatically fills in the school code box with the one that they clicked on. First of all I was wondering if this is the best way to do this sort of task. Secondly, I was wondering if this is possible with just php. Thirdly, I was wondering if there is a good tutorial out there for this type of task. Anyways here is a link to a page that I made that demonstrate smy problem if you don't understand. [a href=\"http://www.d3kicks.com/php_help/\" target=\"_blank\"]Here is the example[/a] Thanks for all the help.
  19. Hey i need some help, I want to convert some numbers so they all have a length of 4, by adding a certain number of preceeding zeros to them. so like 7 would print out as 0007, and 77 would print as 0077. Anyone know the code for this.
×
×
  • 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.