...

View Full Version : How to make a configuration page?



artro1811
12-14-2010, 09:39 PM
Hello, first, I'm new here and I hope you can help me :thumbsup:

The problem is that I'm making a script and I need to have the information of a website on the script which is in a different document.

The code of the website is similar to this:

<html>
<head>
<script type="text/javascript">
var name = prompt("Put here your name");
var surname = prompt("Put here your surname");
</script>
</head>
<body>
</body>
</html>


But I want to give the value of the name and surname to the vars of another script:

var name = "What I have to put here to get the info of the web?";
var surname = "What I have to put here to get the info of the web?";

document.getElementById("name").value = name;
document.getElementById("surname").value = surname;
document.getElementById("loginbutton").click();


Help please!

Philip M
12-15-2010, 07:27 AM
JavaScript is purely a client-side language, and unless used with an Ajax call has no capability to read from or write to a file (except a cookie), communicate with the server, access a database, the client's operating system or the Windows registry, or alter the default behaviour of the browser. And for security reasons JavaScript cannot access anything beyond the domain of the current page. This is known as the "same origin policy" and prevents a document or script loaded from one origin from getting or setting properties of a document from a different origin.


All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

artro1811
12-15-2010, 02:18 PM
JavaScript is purely a client-side language, and unless used with an Ajax call has no capability to read from or write to a file (except a cookie), communicate with the server, access a database, the client's operating system or the Windows registry, or alter the default behaviour of the browser. And for security reasons JavaScript cannot access anything beyond the domain of the current page. This is known as the "same origin policy" and prevents a document or script loaded from one origin from getting or setting properties of a document from a different origin.


All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

So how can I do to make the prompts only in one web page?
For example, I want to get prompts on www.myname.com but not in the others sites.
How can I do?

Philip M
12-15-2010, 03:21 PM
I don't really understand you, but JavaScript is not the answer. You need to use server-side scripting.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum