liamthebof Posted August 31, 2008 Share Posted August 31, 2008 OK, I have a form containing: An input text title box. And input File upload box Another input text box for a size value. My form submits to a php page in an iframe contained on the same page as the form. The php page in the iframe should basicallytake the uploaded file, rename it, add the name of the title to a file called 'list.cfg', then, it should use gdlib to creat the words in title, place them on the image in the font size specofed y the value in the size text box. The image manipulation is fine, I have done all that side, it is currenty more complicated but know need for explanation. What I need to know is firstly, when submit is clicked, before ploading the image, has a name been enetered into title. Then, has the title been used before by reading list.cfg. If they all pass, upload the image and rename it as well as adding title to list.cfg. However, the form may be entered many time by a person adjusting the size of the font by entering a different value in the input size box. the idea is when they click submit, they will get a previw of current progress by showing the current state of the image. As the image file has already been uploaded, the script should be able to tell and when submit is clicked, it must not upload the image again but rather use the direcotry the image was uploaded to. I can do this by using file exists. What I cannot do is get the correct order of if()'s. The fact that the image may exist because someone else has already uploaded it, meaning the name will already be in list.cfg. The fact that the title may have been empty meaning the image shoulds not be renamed/moved. The fact that the name may exist already in the list.cfg and again the image should not be moved. The fact that the image should only be uploaded if its a png under 5 mb (I have that done, dont know where to place it). You see, im baffled. Help appreciated. Quote Link to comment Share on other sites More sharing options...
liamthebof Posted August 31, 2008 Author Share Posted August 31, 2008 OK, got javascript helping me out so, the if's seem to be working. What Im currently stuck on is this $list = my stream get contents of an fopen'ed file. Echo'ed, works fine. $title is a $_POST.. from the form, echoed it, worked fine. Now, I need something that return TRUE if $title is found inside of $list. FALSE if not. I have tried preg_match and stristr but cant get either to work. Help appreciated. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.