Jump to content

jaymc

Members
  • Posts

    1,521
  • Joined

  • Last visited

    Never

Everything posted by jaymc

  1. Ok, I have this bit if javascript for form validation which works great [quote]function validate_form ( ) {     valid = true;     if ( document.form.artistnametxt.value == "If not, write it here" || document.form.artistnametxt.value == "")     {         alert ( "You must select an artist name!!\n\nEither do so from the drop down list or input it manually" );         valid = false;     }[/quote] AS you can see, its setting a variable called valid, that works great aswell However, further down in the HTML I have this in a submit button [quote]OnClick="if(valid==true){this.className='uploadgo'}"[/quote] In other words, if after form validation valid = true then it will change the class name However, I get a javascript error saying valid is undefined I'm, just wondering why
  2. Worked a charm!
  3. [quote author=redarrow link=topic=110817.msg448602#msg448602 date=1160242972] str_replace(); [/quote] Lol. You dont get it If I use str_replace it would be like this [code]$string = 108/1727.wma|108/1734.wma|108/1725.wma|108/1737.wma|108/1732.wma|108/1730.wma|108/1738.wma $newstring = str_replace("108/1727.wma", "", $string);[/code] $newstring would come out like this [b]|108/1734.wma|108/1725.wma|108/1737.wma|108/1732.wma|108/1730.wma|108/1738.wma[/b] Hence, a PIPE at the start ! Which cant be done!
  4. Ok, lets drop you right in it [quote] $string = 108/1727.wma|108/1734.wma|108/1725.wma|108/1737.wma|108/1732.wma|108/1730.wma|108/1738.wma[/quote] I have a form which contains a drop down with each of the above in OPTIONS [code]<OPTION>108/1727.wma</OPTION> <OPTION>108/1734.wma</OPTION> ect..[/code] You get the drift, anyway, when they select one and submit, it needs to remove their selection from $string So, if they selected [b]<OPTION>108/1727.wma</OPTION>[/b] then the string would need to be modified to [quote]$string = 108/1734.wma|108/1725.wma|108/1737.wma|108/1732.wma|108/1730.wma|108/1738.wma[/quote] That bit is simple so far right? well, the problem is, those pipes need to be in the correct places. The string can never start with a pipe, and it can never end with a pipe Now if you have thought ahead, you will see that if they submit to delete either * 108/1727.wma * 108/1738.wma $string will be left with either a pipe at the start or end of the $string. How can I get around this. Its a bit messy, but I've been working on this for over an hour and cant get my head around it [b]Any help?[/b]
  5. jaymc

    Query Syntax

    Worked
  6. jaymc

    Query Syntax

    Ok, basically I want to run 1 query and search for where ID rows = 5 different numbers So essentially it is going to search the entire table and try pull out 5 different rows based on my search criteria Is this the syntax for that [code]SELECT * FROM `artists` WHERE `ID` = '1' AND `ID` = '4' AND `ID` = '7' AND `ID` = '21' AND `ID` = '51' LIMIT 0,5[/code] I just thought their may be another way rather than using all those ANDS maybe something like [code]WHERE ID = '1,4,7,21,51'[/code] [b]Any help?[/b]
  7. That did not work
  8. [code]<INPUT TYPE = Button VALUE = "Click Me" OnClick = "document.write('Hello World')">[/code] Pretty simple right? Well, it works... but not the way I want it too! When clicking, the javascript writes 'Hello World' to the document, but deletes all the content. So, in this example, the form button disapears I want it to just write 'Hello World' underneath the form button for example How can this be achieved Thanks!
  9. I want the content to change without it reloading in META REFRESH style where it flickers. It also makes a little click noise aswell so I really do want to use AJAX for it
  10. I want to use Ajax to refresh an iframe on my site. I have never used Ajax before so I really am lost looking for a script that will do it if someone can write one or has one already made That would be great! Thanks!
  11. [quote author=Destruction link=topic=110187.msg444976#msg444976 date=1159754691] I believe there may be a way to do this though I'm not 100% sure.  I was considering something similar a while ago.  The way I thought of doing it was to use JavaScript/AJAX/PHP.  JavaScript could find the total filesize, though the only way I found so far is tricky with security permissions and unsigned ActiveX (see here: http://www.jguru.com/faq/view.jsp?EID=330134).  AJAX would call a php script which would check the current filesize of the file as it's being uploaded to the server.  This is where I was a little stuck personally as I don't think you can use $_FILES until after the file is uploaded.  Hopefully you'll be able to find out a little more from here as I put my own research on hold some time ago. HTH Dest [/quote] Yeh thats exactly how I thought it could be done for that to work though, you would need to know the file name the the php ["tmp"] dir and just java ajax refresh every 5 seconds and compare the uploaded so far file size to the actually file size Its just how to do that though..
  12. Surely their is another way ! Hmm..
  13. I'm wondering, how do you go about making a progress bar when using an upload form Basically so a user can see the percentage uploaded of their file...
  14. jaymc

    Click link

    Yeh thats the first thing I tried It doesnt work
  15. jaymc

    Click link

    Edit : After a bit of research ive found you set the name of a window via javascript [b]window.name = "base";[/b] So, im now trying to open up a URL from a popup to the base window via [b]OnClick=window.base.location=site.com[/b] Its not working though. Any help?
  16. jaymc

    Click link

    Targetting to _parent doesnt work btw How do you name the parent window?
  17. jaymc

    Click link

    I want to have a popup load on my site and when you click a link on that site the URL loads in the base site Obviously I know how to get the popup working etc, its just getting any link clicked to load in the base site target=?
  18. How do you do it with GD?
  19. Ok, I'll hit you straight with my problem I have 1200+ images on my website that are bmp files. How can I convert them to jpg. ive heard about processing them but from what Ive read its really complicated, unless someone can point me to a prewritten script Any help would be great Thanks
  20. Great, Ive got it working using the following approach [code]if ($type[2] == 1) {$source = imagecreatefromgif($filename);} else if ($type[2] == 2) {$source = imagecreatefromjpeg($filename);} else if ($type[2] == 3) {$source = imagecreatefrompng($filename);} else if ($type[2] == 4) {$source = imagecreatefromjpeg($filename);} else if ($type[2] == 6) {$source = imagecreatefrombmp($filename);}[/code] However, their is no [b]imagecreatefrombmp[/b] How do I handle bmp images?
  21. [code]<? // File and new size $userpic = $_GET['user']; $filename = "pics/".$userpic.".jpg"; // Content type header('Content-type: image/jpeg');   // Date in the past, so that the image is not cached by the browser Header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Get new sizes list($width, $height) = getimagesize($filename); $newwidth = 76; $newheight = 62; // Load $thumb = imagecreatetruecolor($newwidth, $newheight); $source = imagecreatefromjpeg($filename); // Resize imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); // Output imagejpeg($thumb, null, 100); ?> [/code]
  22. well the problem is, the gif files are saved as .jpg So they are true gif files but named file.jpg, so I cant determine if they are gif or not as I cant go by the file extension
  23. I have an upload script that allows people to upload images, adds a bit of text on the image then displays it This works great, but, here is the problem It only works if the file was saved as a JPG! If the image the upload is a gif, then the image does not display. My script needs to support atleast jpeg, gif bmp & png Obviously imagejpeg() does not support anything other than true jpg files Any way around it / alternitives?
  24. Song ID's. In other words, I want it to auto increment from the last ID in the table
  25. I have my ID field set up as auto increment Now, lets say I have the following in a database in the ID field 1 2 3 4 If I delete record 4, that means I will be left with 1 2 3 However, and here is my problem. When a new record is added, it auto increments the ID field to 5. Obviously their is some kind of counter which still holds 4 as the last number. Is their anyway around this without querying the database?
×
×
  • 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.