help pls on taking url value

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shotokan99

    help pls on taking url value

    hi,

    i have this situation:

    i will pass a url to a certain site and this site will dynamically
    generate a new url. my issue i want to that new url and assign it to
    my string variable. how to do this?

    tnx

  • mypetprogrammer@gmail.com

    #2
    Re: help pls on taking url value

    On Jun 5, 1:56 am, shotokan99 <soft_devj...@y ahoo.comwrote:
    hi,
    >
    i have this situation:
    >
    i will pass a url to a certain site and this site will dynamically
    generate a new url. my issue i want to that new url and assign it to
    my string variable. how to do this?
    >
    tnx
    If you're sending it via GET, just use the htmlspecialchar s();
    function to make it acceptable in a url, then send it across. When you
    get it out in the new page, you'll have your URL.

    ~A!

    Comment

    • shotokan99

      #3
      Re: help pls on taking url value

      actually this is how i did it:

      1. i have a textbox for the user to encode the url
      2. by $_POST['x'] ill evaluate the url if valid or not using
      file_get_conten ts().
      if(!file_get_co ntents($x){
      // do actions here..
      }

      however i dont know if what is wrong, file_get_conten ts() works
      perfectly on
      my local machine but upon loading to our webserver, it doesn't work
      at all.

      3. the next action is to $x as param value 'http://www.my...com?ur l='.
      $x.
      now this url will then dynamically produce another url. and that
      new url is
      the one that i want to get and assigned it to a string.

      but i want all process to be totally invisible to the user. because
      after
      successfully getting the new url i post a message like your new url
      is ...

      is this possible? how to do this?

      Comment

      • Rik

        #4
        Re: help pls on taking url value

        On Tue, 05 Jun 2007 11:39:38 +0200, shotokan99 <soft_devjava@y ahoo.com>
        wrote:
        actually this is how i did it:
        >
        1. i have a textbox for the user to encode the url
        2. by $_POST['x'] ill evaluate the url if valid or not using
        file_get_conten ts().
        if(!file_get_co ntents($x){
        // do actions here..
        }
        >
        however i dont know if what is wrong, file_get_conten ts() works
        perfectly on
        my local machine but upon loading to our webserver, it doesn't work
        at all.
        allow_url_fopen enabled at home and disabled on the server?

        Also, I'd just do a HEAD request using fsockopen(), unless you really need
        the contents of the site in question.
        --
        Rik Wasmus

        Comment

        • shotokan99

          #5
          Re: help pls on taking url value

          actully i dont need to really get the contents. all i wanted to do is
          to find out if it is a valid url or not. the contents doesnt matter to
          me.

          regarding my next question on getting the url? how to do it?

          Comment

          Working...