Solved

Dhtml to perl

Posted on 1998-09-21
4
186 Views
Last Modified: 2010-04-09
I am dynamically reassigning the positions of some graphics on a web page with the mouse but after I am done I would like to be able to send the position coordinates( with a submit button) to a perl script to be stored so that these rearranged pages could be reloaded by calling the script to dynamically output the page with the coordinates which had been stored previously. Is this doable?
0
Comment
Question by:guadalupe
  • 2
4 Comments
 
LVL 3

Author Comment

by:guadalupe
Comment Utility
Edited text of question
0
 
LVL 8

Accepted Solution

by:
jbirk earned 200 total points
Comment Utility
This might be do-able, but it depends on when you want the co-ordinates to be submitted.  On some event or at a time interval?  Will this submitting refresh the screen or does it need to happen in the background (invisible frame).  Also, you will probably need to record the IP address in the cgi script so you know which saved coordinates to use.  Then when the user loads the page it will check to see if their IP address accessed this page within the last xx minutes (whatever the time period is) and loads the page with the dynamic locations set to what was saved.
And saving them would involve an IP and date stamp followed by the list of coordinates.

This is all do-able, but can be very complicated, and it depends on you knowledge of Perl as well (can you do this stuff in Perl?)  I can help with Perl, but you might get better help for that aspect via the cgi section.  I CAN do a good job in helping you with the rest of setting this up.

Good luck!
-Josh
0
 
LVL 28

Expert Comment

by:sybe
Comment Utility
It seems to me not so hard, although I dob't know enough of DHTML to answer it easily:

A perl script, means that a form is submitted, right ?

So in the form there should be some hidden fields, each for an image position.

The "onSubmit" call a JS-function that puts the cureent positions of the images in the hidden fields, and then the form is submitted.

When perl returns some values, it includes the values for "current position" that it receives.

But...... this all is very complicated, if you want to same page to re-appear after a submit, then it's better to use a "hidden frame" to which the form is submitted. It leaves the current page untouched, and you could evt. process the return data using javascript.

0
 
LVL 3

Author Comment

by:guadalupe
Comment Utility
Thanks for the responses.  Yes it is a tricky one but not as much as you think.  The point is to allow people to "save" a page setup and the recall it at a latter date and only upon specific request.  Therefore a user name/ip address will probably be the way to go for storage/retreval of the data.  The real stubling block for me was the passing of the x,y to the script but as suggested I think the way to go is hidden fields with a JAVA script which assigns the x,y coordinates into the hidden name/value pairs.  This JAVA could be run at the onClick event of the submit button which should process before the action executes (i.e. the actual submission of the names/values to the script)  While I do feel confident that I can pull it off I would love any feedback especially pitfalls to watch for.  Also please let me know if anyone wants the final resulting script.  (though you may have to wait as other design priorities call)  Thanks Jason  
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now