Jump to content

[SOLVED] Cant get my head around this.


liamthebof

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.