Hi,
I've got a php image upload/resize script working...its working fine for jpegs, gifs(both transparent and not) but pngs's just wont work....it all uploads fine...creates the thumbnail....bu t when you view it its 0bytes...the original file uploads fine...its just after trying to resize.
Theres no errors in the log file.
Heres the relevent parts of the script...all the variables used in the script are...
User Profile
Collapse
-
imagepng returning 0 bytes image
-
Problem fixed....it was upload_max_file size being set to 2mb in my php.ini......up ped it to 5mb and it works fine.
The problem wasn't with exif_imagetype it was because my $_FILES[''] values were empty....duhh! -
exif_imagetype wont work on large(width&height) images
Hi,
I'm trying to allow my clients to upload some photographs...t hey are taking the photos on an iphone and the dimensions are 2500px wide iapprox.
I'm using exif_imagetype to determine the image type but when the image is over 1500px approx it wont detect the image type.....anythi ng under and it detects and uploads fine.
Heres the code in question:
Code:$extensions = array(IMAGETYPE_GIF => '.gif',
-
I thought [a-z] specified the range of letters between a and z? along with 0-9 etc or cant you use preg_match that way?Leave a comment:
-
preg_match issues
Hi is there a specific way to check for preg_match.
Only reason i ask is im having trouble even matching basics.
I have a validation script with a function like this(for example...simpl ified for testing)
Code:function AlphaNumeric($value){ if(preg_match("/^a-z/", $value)){ return true; } }
Code:if(!$validation->AlphaNumeric($value){
Last edited by Dormilich; Aug 31 '11, 06:31 AM. Reason: please use [CODE] [/CODE] tags when posting code -
Hi, if i was to implement this then i'd make sure i had a rollback feature aswell as a testing environment.... .its just to make things easier for me in the long run...if i had 1000 sites im sure it would get more and more difficult to keep them all updated...but thanks for the feedback.
For now ill just stick with multiple uploads.Leave a comment:
-
reference files from external server
Hi, im building my own CMS and wish to have my files hosted on 1 server for easy updating rather than sepperate uploads into different hosting packages etc.
My clients websites will all be hosted on different servers but i want them to access the CMS from one set of files so when i make updates they are applied to all clients.
I've tried using fopen/file_get_conten ts etc which works fine but my problems are with server... -
Not sure if I fully understand.
Are you wanting to select them all in one go and arrange the match ups then? or save some for later and select them then?
If you're matching them all up in one go can you not store the matched values in an array so when you come to create your next matchup you know who has already been selected?
or if you want to store the matched values you could store them like
Team 1...Leave a comment:
-
change focus when textarea overflows
Hi,
I have 2 fixed width and height textareas. with transparency and scroll bars/border hidden.
I am letting people type text into the 1st textarea....whe n they type enough text to cause the textarea to overflow/require scrolling(verti cally) i would like the focus to shift to the 2nd textarea automatically.
I tried using element.scrollH eight but it only returns the height not including vertical scroll.... -
I've actually just checked again and its not working at all(any browser)....the input definitely has an id set.
even this document.getEle mentById("fname b").value="test ";
doesnt work....fnameb is the id.
any reason why that wouldnt work?Leave a comment:
-
set text input value onclick etc
Hi,
Its something stupidly simple but for some reason i cant find a straight forward cross browser solution.
I've got 2 sets of address fields and i want a tick box that when the user clicks it populates the 2nd lot of boxes with the values in the first.
I had it working in I.E ok using the following;
Code:document.getElementById("inputid2").value=document.getElementById("inpu
-
run automated functions on website
Hi Sorry if i'm not posting in the right category.
I have a function on my website which I need to run twice a week....on 2 specific days.
i need this to run without any interaction...n o button presses etc and without the website being viewed.
I know it can be done but im worried its out of my skill zone....the website is php/mysql based.
Plaese can you tell me what options are available... -
Hi,
Thanks for pointing that out.....i kind of knew that but still didnt realise that was my porblem....whic h it was sot thanks.
The only part i cant get to work now is the resizing
Code:$imgsize = GetImageSize($subimgfile); if (($imgsize[0] > 200) || ($imgsize[1] > 200)) { system("djpeg $subimgfile >$subimgfiletmp"); system("pnmscale
Leave a comment:
-
cant get copy or move_uploaded_file to work
Im trying to get an image upload script to work within a session file.....i can get it to work on a single page without any other script....but i need to have the image upload facility built into a add product form....so the script is currently sitting in a session file at the same point as where the fields are all validatedd....i 've tried using copy and move_uploaded_f ile.
I know the structure of the code is probably not great but... -
Hi...the yourprice field is VARchar...so this could me my problem...its mysql 4 however i can alter it to 5.....but i think i have to re-create the database...dont think it lets me just upgrade it...which could cause problems?Leave a comment:
-
Hi,
I printed the query and this is what is print.....all looks fine to me.....when i search for less than 20.00 they all show even the 2.99 one...yes when i search < '10.00' nothing shows...not sure what the issue is?
[code=mysql]SELECT * FROM iswapbooks_book s WHERE status = 'active' AND isbn LIKE '%%' AND title LIKE '%%' AND topic LIKE '%%' AND university LIKE '%%' AND yourprice < '10.00'[/code]
...Leave a comment:
-
SQL Less Than returns wrong results
I have an sql query which has several fields and no matter how hard i try i cant get the less than statement to work....i originally tried between but that wouldnt work either.
$yourpricesearc h is the name of the drop box with in the search form with the price values of 5.00, 10.00, 15.00 etc...i did it this way as i wasn't sure if when i put the AND in when the value of $yourpricesearc h was empty would cause problems so im only putting... -
PHP/MYSQL Book search
Im building a php/mysql book swap site and need to integrate an isbn book search facility where the userenters the isbn no. and the fields are filled with the relevent info.
I know there are sites that offer free searches and databases to buy of the books but im not quite clever enough to do this i dont think.
Few questions then
1. Is it possible without buying a database
2. If so...how hard and does... -
Hi, i used the create statement to create the basic fields, but since then i've added a few manually, theres a user id field in my users table but its a random 32 var character, my category table doesnt yet have 1 and was created manually.
is it too late to add a primary key field in now, does it need to be done from the start.
I'm new to mysql etc so still learning a lot.
Using this method i managed to...Leave a comment:
-
Hi, sorry if im a numpty, im not really an expert at sql statements so most of that goes past me .i.e the _fk part.
here is a table to illustrate the structure i have.... all letter casing is correct.....i understand the field/table naming is probably crap but i can alter that after.
[HTML]<table width="100%" border="1" cellspacing="5" cellpadding="10 ">
<tr>...Leave a comment:
No activity results to display
Show More
Leave a comment: