/    Sign up×
Community /Pin to ProfileBookmark

location string

I’m need to run scripts within a page based on what is written in the window.location. To explain, here is what I had. But because SSL and javascript don’t work togeather, this doesn’t work:

<script>
{
var paramValue;
document.write(‘<!–#include virtual=”script.cgi?db=file1&info=next&string=’);
if( paramValue=window.location.search.match(/[?&]info=(w+)/) )
document.write( paramValue[1] );
document.write(‘” –>’);
}
</script>

Then the location of the file would be file.shtml?info=home1

Now in an ideal world:

<!–#include virtual=”script.cgi?db=file1&info=next&string=home1 –>

would be written into the page and with that the database. But this does not work and so I wonder if anyone has another idea. Even if using cgi og something…?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Mar 27.2008 — You can not have JavaScript writeout serverside code. Serverside code only executes on the server and running it with JavaScript means it is too late since the server has completed the code and sent everything down to the client.

You need to figure out how to do it on the server.

Eric
Copy linkTweet thisAlerts:
@ingimarauthorMar 27.2008 — Thanks for the response.

Any idea how I could do it on the server or where I could get help with this?
×

Success!

Help @ingimar spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...