PDA

View Full Version : code generator



Jenny
07-30-2006, 12:04 PM
Is it possible to have a form which 'generates code' from information from the form? e.g. if the form was....

Article Title Field

Article Authors Field

The form would generate this code which woul dappear in some box beneath the form for the user to copy and paste:

<title>Article Title</title>
<meta name=”description” content=”Article Authors”>

kassi59
07-30-2006, 01:33 PM
Im not quite sure what exactly you are looking for. I can direct you to have a look at phpFormGenerator in your fantastico...you also might take a peek at Dew-NewPHPLinks, also in fantastico.
Hope that will get you further along!

navaldesign
07-30-2006, 04:13 PM
It is not the form that can generate the code, but a script that receives the info from the form and generates the code. Please explain excactly what you want to accomplish

Andy128
07-30-2006, 06:19 PM
Like Navaldesign said- it is the coding that produces what you are trying to do. You could have a form with fields to fill in and the php script would out-put that data in what ever format you wish (generally speaking). This can eaisly be accomplished using the echo() or print() command in php.

Post what you would like to do and explain how you would like it to appear -that way we can figure something out for you.

Andy

Jenny
07-30-2006, 07:26 PM
Well, I want people to submit articles to my site.

However, most of these articles tend to be PDFs and have (totally) useless title and meta descriptions.

So, users submit text files with the title, author and publisher information substituted in as below:

<title>ENTER THE ARTICLE TITLE HERE (ENTER CITATION HERE) - ENTER PUBLISHER HERE</title>
<meta name=”description” content=”ENTER THE AUTHOR NAMES HERE”>

Then, my search engine can read these text files and substitute in useful title and meta descriptions.

BUT, many of my users would not be that computer literate and turn off as soon as they saw they had to manipulate the above code.

So, if the form could 'generate' the code, all the user would have to do is enter the title, authors and publisher into the appropriate form fields.

They would then copy and paste the generated code (which would magically appear in a box beneath the form) into a text file (without having to think about whether they got the code right) and just upload it.

I hope I made some sense!

navaldesign
07-30-2006, 07:29 PM
yes, it can be done easily. Contact Watdaflip Form Scripting Service (http://www.vodahost.com/vodatalk/free-classifeds/8122-form-scripting-service.html) and he will do it for you. If not, post back and i will.

Andy128
07-30-2006, 07:33 PM
Don't understand the need to cut and paste? C & P into what file?

What is done with this file and how is it merged or incorporated into the pdf file (as far as a title and meta description) that they are uploading?

Are you uploading this to a database?


Andy

navaldesign
07-30-2006, 07:40 PM
Andy, i beleive she will have a page for each author, and needs the meta tags for the page.

Andy128
07-30-2006, 07:49 PM
I am still confused as to the cut and paste? Wouldn't the form collect the info and e-mail it to her to encorporate into the page herself?

Andy

Jenny
07-30-2006, 08:14 PM
The text files are desc files with the extension pdf.desc. The search engine identifies the desc file as being associated with a particular pdf, and then uses the title and meta information in the desc file instead of the (useless) data in the pdf. The search results then contains useful title/author/publisher information instead of "No Job Name" or something.

If anyone knows of an open-source script please let me know. Thanks for all your help.

Andy128
07-30-2006, 08:54 PM
Jenny-
Thanks. I am intrigued about this and will look into it. Currently- how do you create such a file? With notepad? Modify the pdf itself?

Thanks again.

Andy

Jenny
07-30-2006, 09:05 PM
To create a desc file (desc for description)

Open a Notepad file > File > Save As > All File types > "blah.pdf.desc"

No modification of the pdf is required, the search engine now gets the title and meta description from the pdf.desc file.

e.g. for a pdf called "cars.pdf", the search engine will look for a text file called "cars.pdf.desc".

Andy128
07-30-2006, 09:18 PM
So the search engine searches the desc file and then you link the desc file to a particular pdf file? Correct?

Could you post a typical desc file so I may have a look at its composition?

Thanks again for your time in teaching me this.

Andy

Jenny
07-30-2006, 09:37 PM
I tried to upload a pdf.desc file but the forum won't let me (sorry - just says 'invalid'). But I have uploaded these files to my webserver and they work fine.

The search engine indexes the pdf first. Then, the search engine can be programmed to look for a corresponding pdf.desc file on a particular website. If it finds one, it will use the title/meta information in the desc file for the pdf, but there is no "link" between the pdf and the pdf.desc file.

I don't know how the search engine knows to look for the desc files though. The Zoom search engine is the model I have and you can ask the people who developed it (www.wrensoft.com (http://www.wrensoft.com/)).

This is why I need the form to generate the code for novice websurfers so they can create these text files. Thanks for your help.

Andy128
07-30-2006, 09:50 PM
Yes I understand now. The reason I asked is that you could create a form where they uplod their pdf file and then enter info you request to create the desc file. Then when them hit submit- it would upload the pdf file to your site and create a desc file automatically with the appropriate name and store that file on the site.

Thanks for the info. I am going to look into this. Navaldesign is correct- contact Watdaflip and he would be able to do all this for you. I have used his services and he is very reasonable and knowledgeable.

Contact him via this link;
http://www.vodahost.com/vodatalk/free-classifeds/8122-form-scripting-service.html

Cheers,
Andy