Results 1 to 9 of 9

Thread: questions about php

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,547

    questions about php

    ok here are a few questions.

    1. how do u open another site with fread i know its possible but i cant get it to work its like u need an option enabled on the server. anyhelp?

    2. wat other webbased langauges can be using right in php

    3. is there anyway to play music with php?

    thanks in advance, high6

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: questions about php

    1. Try file_get_contents(). Specifically note:
    Tip: You can use a URL as a filename with this function if the fopen wrappers have been enabled. See fopen() for more details on how to specify the filename and Appendix M for a list of supported URL protocols.
    2. You can embed PHP script code in any kind of file, if the file has a .php extension it will be parsed by the PHP script engine for PHP code.

    3. You could play music on the server. But that's no use to anyone. It's a client-side operation so you would need an embedded component on the page, like Flash or some other applet that can play music in the user's browser. Nothing to do with PHP.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,547

    Re: questions about php

    Quote Originally Posted by penagate
    1. Try file_get_contents(). Specifically note:


    2. You can embed PHP script code in any kind of file, if the file has a .php extension it will be parsed by the PHP script engine for PHP code.

    3. You could play music on the server. But that's no use to anyone. It's a client-side operation so you would need an embedded component on the page, like Flash or some other applet that can play music in the user's browser. Nothing to do with PHP.
    oops i think i made a typo on 2. i was wondering wat langauges u can use IN php. basicly the oppisite of wat u said.

    also 1. like i said doesnt work i need to change something on my server or something because if gives me an error w/e i try it.

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: questions about php

    What's the error?

    As per 2, what do you mean by "languages in PHP" ? PHP is a language.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,547

    Re: questions about php

    Quote Originally Posted by penagate
    What's the error?

    As per 2, what do you mean by "languages in PHP" ? PHP is a language.

    it says like, "couldnt find www.google.com in directory www.website.net/something/moresomething/test/"
    and i heard that i have to change an option on my server to allow this in php.ini but i dont know how to do that.

    like is there a way i can use javascript in php or html.

  6. #6
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: questions about php

    You need to fully qualify the URL, as in http://www.google.com.

    Javascript - is a client side language, you can place it in <script> tags in HTML code - PHP doesn't affect that at all. PHP is simply code that is run on the server, that controls the output. You can use PHP code to control what Javascript code is outputted if you wish, but the Javascript itself will still only run on the client side which is the user's browser.

    It's very important that you are absolutely clear on the difference between server-side and client-side programming. If you completely understand the concepts then after that it is really very easy.

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,547

    Re: questions about php

    i got another question.

    how do u get the url of the website viewing the current .php like if u viewed it from www.google.com then it would return www.google.com not where i hosted it.

    thanks.

  8. #8
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: questions about php

    You mean if your page becomes part of a frameset like an image result on Google?

    You can use Javascript for that - the value you want is window.top.location.href.

    Or do you mean if the user follows a link from google? In that case, in PHP, you can access it using $_SERVER['HTTP_REFERER'].

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,547

    Re: questions about php

    Quote Originally Posted by penagate
    You mean if your page becomes part of a frameset like an image result on Google?

    You can use Javascript for that - the value you want is window.top.location.href.

    Or do you mean if the user follows a link from google? In that case, in PHP, you can access it using $_SERVER['HTTP_REFERER'].
    well im gonna have an image for a sig somewhere else that gets the source of the site its being viewed from and search for stuff. so i was wondering how to get the site its being currently viewed form.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width