/    Sign up×
Community /Pin to ProfileBookmark

opening a browser window with a url string

Hi,
I asked this in php first, but they directed me to javascript forum…

I have a variable that I obtain from a php code. This variable contains a link such as [url]http://.[/url]……

with this variable, say $a, once I obtain it with that php code, I want a browser window to open automatically.

I dont know javascript. can you give complete code to do this?

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@KorMay 12.2011 — 

with this variable, say $a, once I obtain it with that php code[/QUOTE]

Obtain how? What should user do in order to ... to what: to open a window in a pop-up? Or to open that address in the same window?
Copy linkTweet thisAlerts:
@ketancoauthorMay 12.2011 — Obtain how? What should user do in order to ... to what: to open a window in a pop-up? Or to open that address in the same window?[/QUOTE]


ok... i didnt want to write long not to confuse, and thought my question was enough and how did i obtain the variable doesnt matter, and in a pop up or smae window doesnt matter either... but here is the history, since you asked....

i have a form. in that form, i enter a youtube url address. call this file form.php

once i enter that youtube address, it posts the info to the second file. say parse.php. that parse php modifies that string so that i have a new string now. and that string, once pasted in a broswer window, brings up a youtube video's thumbnail. (i.e. http://img.youtube......) later i use this thumbnail in my blog. since i do this many many many times as i write many many many posts, i want to do this copyin and pasting automatically. so that once i enter the youtube address, to the form file, the secind file, parse.php automatcally opens a new window, which gives me youtube thumbnail. (in same window or anotehr doestt matter) right now i am doing this copying and pasting manually... as i will do this 100000000000 times in the future, i want to eliminate this copy and paste step and do this automatically, to save 100000000000 x 2 seconds = 20000000000000 seconds....
Copy linkTweet thisAlerts:
@KorMay 13.2011 — Can't you do it by simply using PHP?
[code=php]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
</head>
<body>
<form action="" method="get">
<input type="text" name="address">
<br>
<input type="submit" value="Send">
</form>
<br>
<br>
<?php
if(isset($_GET['address'])){
echo $_GET['address'];
}
?>
</body>
</html>
[/code]

Of course, by submitting the value to another file (above I have submitted to the same document)
Copy linkTweet thisAlerts:
@ketancoauthorMay 13.2011 — Can't you do it by simply using PHP?
[code=php]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
</head>
<body>
<form action="" method="get">
<input type="text" name="address">
<br>
<input type="submit" value="Send">
</form>
<br>
<br>
<?php
if(isset($_GET['address'])){
echo $_GET['address'];
}
?>
</body>
</html>
[/code]

Of course, by submitting the value to another file (above I have submitted to the same document)[/QUOTE]


i am already doing that part. and at the end i have a variable. which contains the web address. (so we are where i asked my question, back to square one) now i want a browser window to open atuomatically with that variable.

in your code you are not opening a browser window, which was my question.
×

Success!

Help @ketanco 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...