hosted by liquidweb

Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : some code help

Forum Jump

some code help

Reply Post New Thread In Programming Discussion Subscription
Send news tip View All Posts Thread Tools Search this Thread Display Modes
Web Hosting Evangelist
Join Date: Jul 2003
Posts: 527

some code help

i want to make a script that does the following

some one puts a code in there pages like this

<SCRIPT language="JavaScript" src=""></SCRIPT>

which would load a java script with that userid inside it
like ('','_blank','top=1,left=1,width=550,height=300,buttons=1,scrollbars=1,location=1,menubar=1,resizable=1,status=1,directories=1,tool bar=1'),win2.blur(),window.focus();

so the php script will echo out the java script and add userid inside it

any one knows how to do this ?

the end reselt the user with this code
<SCRIPT language="JavaScript" src=""></SCRIPT>
in there page will be converted to
<SCRIPT language="JavaScript" src="my java script inside the script.php with userid inside it"></SCRIPT>
most important that the userid changes for each member

Sponsored Links
Web Hosting Master
Join Date: Aug 2002
Location: Canada
Posts: 649
That's kind of an off approach.

What you want to do is define your page with a link that 'onclick' calls your window open script.

you can't do this with javascript alone. You'll need a technology like PHP.

1. Build an HTML page and replace userid with %USERID% - ni our example it will be template.htm

2. Build a PHP page that has available the user's id, in a SESSION variable, or POST - anything you like. If it were stored in a SESSION array it would look like this:

session_name( 'somename' );

$fp = str_replace( '%USERID%', $_SESSION['userid'], implode( '', file( 'template.html' ) );

echo $fp;
this way, the php file reads the unparsed template, replaces %USERID% with the actual user id, and then echoes the result.


Web Hosting Evangelist
Join Date: Jul 2003
Posts: 527
how would the php script know what is userid is ?
this code will change like
<SCRIPT language="JavaScript" src=""></SCRIPT>

<SCRIPT language="JavaScript" src=""></SCRIPT>

the php script must think the and then use it in the templete.html

Sponsored Links
Web Hosting Evangelist
Join Date: Jul 2003
Posts: 527
up up up and away

Web Hosting Evangelist
Join Date: Jul 2003
Posts: 527
any one home ?
is there any other site which has more programers ?
its a simple idear
a code in one page that calls a php script
<SCRIPT language="JavaScript" src=""></SCRIPT>

and this php script in turn gets the userid from the code "id=" and then prints a java code with that same userid

like (' id=userid','_blank','top=1,left=1,width=550,height=300'),win2

and because the php script was called between <script> and </script> it will be like the original code was

<SCRIPT language="JavaScript"> (' id=userid','_blank','top=1,left=1,width=550,height=300'),win2


Related posts from
Title Type Date Posted
Web Host Code Spaces Closes Shop After Hacker Deletes Customer Data Web Hosting News 2014-06-19 16:34:41
Web Hosting Sales and Promos Roundup - May 2, 2014 Web Hosting News 2014-05-23 16:54:17
Web Hosting Sales and Promos Roundup – April 11, 2014 Web Hosting News 2014-05-23 15:42:21
Free Registration with the WHIR Coupon Code Blog 2014-01-30 13:24:20
Web Hosting Sales and Promos Roundup - October 4, 2013 Web Hosting News 2014-05-23 15:42:45

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Log in with your username and password

Forgot Password?
WHT Host Brief Email:

We respect your privacy. We will never sell, rent, or give away your address to any outside party, ever.

Web Hosting News:
WHT Membership
WHT Membership



Welcome to

Create your username to jump into the discussion! is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.

(4 digit year)

Already a member?