Jump to content

Newbe Question: Firefox


uk_skinner

Recommended Posts

I just got a server from TotalChoice and am a newbe for this. Please forgive me if my questions are too naive or I posted the wrong place. Moderator, please move my post to anywhere if this thread is not the right one.

 

I would like to use FireFox to processing some website and saved the resulted source of that page using PHP script. Here are my questions:

 

1) Where I can install the FireFox (Linux) or we have already got one?

 

2) What PHP codes I should use to accomplish it?

 

Any suggestion or help are appreciated.

 

Thanks in advance.

Link to comment
Share on other sites

uk_skinner Welcome to the Family and the forums. :(

 

Please ask any questions, members here love to help and are here to assist with any questions.

Now as far as your questions go

1) Where I can install the FireFox (Linux) or we have already got one?
I am thinking you are referring to the Firefox Web browser which you can download from Firefox Site

 

as far as your second question goes I am not clear as to what it is your trying to accomplish

 

2) What PHP codes I should use to accomplish it?

what are you trying to accomplish ?

Link to comment
Share on other sites

uk_skinner Welcome to the Family and the forums.

 

Please ask any questions, members here love to help and are here to assist with any questions.

Now as far as your questions go

 

Thanks for the warm welcome. I was a little bit nervous. :sweatdrop:

 

I am thinking you are referring to the Firefox Web browser which you can download from Firefox Site

 

Thanks. I do know where to download it. Can I install the Linux version on my server?

 

Sorry, I was not very clear about what I would like to accomplish. I would like to install FireFox browser on the server and be able to execute from a PHP scripts. When I open a webpage, the output has been processed by the browser at my PC side (client side). I was looking for a possibility to have website processed at server side then download the resulting source code (containing some processed data) to my PC (client side). Based on my limited knowledge, I do need a browser at server side, right? Thansk for the help

Link to comment
Share on other sites

You are quite welcome

Thanks. I do know where to download it. Can I install the Linux version on my server?
you can install firefox on your PC the browser is not executed from the server... it is used as a means to view what web code you have on your webserver (here at TCH) Linux servers.

So if you want to use Firefox you would just install at home on your PC and open it just like you would Internet Explorer or any other Browser you may be using.

 

Sorry, I was not very clear about what I would like to accomplish. I would like to install FireFox browser on the server and be able to execute from a PHP scripts. When I open a webpage, the output has been processed by the browser at my PC side (client side). I was looking for a possibility to have website processed at server side then download the resulting source code (containing some processed data) to my PC (client side). Based on my limited knowledge, I do need a browser at server side, right? Thansk for the help

 

Now if your interested in doing some Server Side Scripting using PHP you would incorperate your PHP code into your web page code and when you view the web page the PHP code would execute.

does this help ?

 

Maybe if you had an example of what it is your wanting PHP to do I could provide you with an example. If I cannot I am sure others here Can.

:sweatdrop:

Link to comment
Share on other sites

Wow...Robert, you are quick and very helpful..This is like a dream come true for a newbie. :sweatdrop:

 

Here is one of example :http://de.weather.com/weather/local/GMXX0128.

 

When I tried to get source codes of that page using the PHP codes:

 

$baseurl = "http://de.weather.com/weather/local/GMXX0128";

$weatherroot = file_get_contents($baseurl);

 

The result was :

"<html>

<head>

<meta http-equiv="Pragma" content="no-cache">

<meta http-equiv="Refresh" content="0;URL=http://de.w2.weather.com/common/jump2_de.html?/weather/local/GMXX0128?">

</head>

 

<body>

 

<img height=1 width=1 border=0 src="/RealMedia/ads/adstream_nx.ads/noad.weather.com/noad@TopBanner">

 

 

<img src="http://fcgi.weather.com/fcgi-bin/partner_redirect/partner_url.pl?ref=(none)" alt="" width=1 height=1 border=0>

 

 

</body>

</html>

 

And if I did "echo $weatherroot", then I saw the right page on my PC browser.

 

I guessed what happened was the original url "redirect" to a url containing the right source code. Am I right? :dance:

 

I need to have the source codes of the final "weather page" to extract the weather infromation within it using my PHP script on the server. So that was my impression that I need the server to have browser to "process" the website first then I can get information extracted then send them back to client side.

Link to comment
Share on other sites

:sweatdrop: Welcome to the Family :dance:

 

and your new home!

 

You cannot see the php code from a web page by viewing the source code with your browser,

the php code is processed by the server and the results are served to the visitors browser.

 

If you are trying to add the local weather to your site,

I did see a link for add the weather on your site.

 

if this is not what you want, please feel free to ask all the questions you want.

 

We really are like family here.

So if you need anything,

just ask your new family!

We love to help :)

Link to comment
Share on other sites

Don your so much faster than I am at replying with links.... LOL :sweatdrop:

 

 

I was just going to say if all your trying to do is add weather information to your own Webpage then visit the link that Don Just posted. it is pretty simple to use and no PHP would be required. an example would be if you looked at this site where I have a small weather symbol there showing current conditions....

 

all it uses is the following code

><a href="http://www.wunderground.com/US/CT/stamford.html">
       <img src="http://banners.wunderground.com/banner/infoboxtr_both/language/www/US/CT/STAMFORD" alt="Click for Stamford Area Forecast" height=108 width=144></a>
   

Link to comment
Share on other sites

:sweatdrop:  Welcome to the Family  :dance:

 

and your new home!

 

You cannot see the php code from a web page by viewing the source code with your browser,

the php code is processed by the server and the results are served to the visitors browser.

 

If you are trying to add the local weather to your site,

I did see a link for add the weather on your site.

 

if this is not what you want, please feel free to ask all the questions you want.

 

We really are like family here.

So if you need anything,

just ask your new family!

We love to help  :)

 

 

 

Thanks, Don.

I got a dog too, he is a westy. :)

 

:oops:

Sorry to my bad English.

I was not trying to view the source of PHP, I was trying extract the weather infromation from that weather page which I can see the source from my PC side browser. So my logical is (maybe it is wrong), if I can use the browser on my PC (client) to view the source of the weather page, can I have a browser on the server and get source code out (of website not PHP). It is just like I can open the website, view the website and view the source code and save as a text file from my PC. Can I write a PHP script and let the server do all the tasks? That means everything is executed at server site then I can download the results (text format of source code of that weather website). Am I too naive? :P

Link to comment
Share on other sites

Thanks for pointing out the sites.

 

However, just fill my curiosity. Please take look my PHP scrips

 

<?php

$baseurl = "http://de.weather.com/weather/local/GMXX0128";

$weatherroot = file_get_contents($baseurl);

header('Content-Type: text/plain');

echo $weatherroot;

?>

 

The echo page I saw was again like this :

 

<html>

<head>

<meta http-equiv="Pragma" content="no-cache">

<meta http-equiv="Refresh" content="0;URL=http://de.w2.weather.com/common/jump2_de.html?/weather/local/GMXX0128?">

</head>

 

<body>

 

<img height=1 width=1 border=0 src="/RealMedia/ads/adstream_nx.ads/noad.weather.com/noad@TopBanner">

 

 

<img src="http://fcgi.weather.com/fcgi-bin/partner_redirect/partner_url.pl?ref=(none)" alt="" width=1 height=1 border=0>

 

 

</body>

</html>

 

Not the webpage I saw at http://de.weather.com/weather/local/GMXX0128 on my browser. :sweatdrop: :dance:

Link to comment
Share on other sites

you are welcome uk_skinner,

 

I am still not sure what it is your trying to accomplish with this though

 

Are you trying to display This Page

in your website as in a Frame ?

 

Or just adding a link to it so it will be displayed ?

 

Or trying to get the peices of that information from that page to display on your page ?

 

 

ps I copied that php and ran it on my page and it redirects me to This Page

automatically

Link to comment
Share on other sites

you are welcome  uk_skinner,

 

I am still not sure what it is your trying to accomplish with this though

 

Are you trying to display This Page

in your website as in a Frame ?

 

Or just adding a link to it so it will be displayed ?

 

Or trying to get the peices of that information from that page to display on your page ?

 

 

ps I copied that php and ran it on my page and it redirects me to This Page

automatically

 

 

Robert, thanks for being patience with me. This is all the newbit can hope for.

 

In simple words, yes I would like to able to get pieces information from This Page. I was hoping using the PHP codes to get all the contents containing weather information. Instead, I only got the contents of "redirecting" codes.

 

Is this something impossible to do?

Link to comment
Share on other sites

Hi and welcome to the forums :)

 

Sorry, I dont speak german but I think this page (is in english) explains what you need to do to publish their content on your site (if that is what you want to do :) ):

http://www.w3.weather.com/services/oap.html?from=servicesindex

 

Thanks Thomas

 

I think I will take more details look in that site.

 

At this moment, this just my hobby and a way to learn PHP script. No intention to have my site becomes a "commercial" site. Understanding how the PHP script is much more important to get the weather information. Do I make any sense?? :clapping:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...