php-windows Digest 10 Jul 2004 16:57:57 -0000 Issue 2313

Topics (messages 24135 through 24137):

Re: HTML (Web Site) Parser
        24135 by: Justin Patrin

iis header redirect does not update url
        24136 by: Jonathan Kart
        24137 by: Jordi Canals

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
http://pear.php.net/package/HTTP_Client

That package supports posting data and deals with cookies and such so
that you can login to a site and get pages from it afterwards.

You can then use something like HTMLSax to parse it if you really need
it. I use Perl regular expressions myself for simple HTML parsing.

On Fri, 9 Jul 2004 09:40:27 -0700, Flint Doungchak
<[EMAIL PROTECTED]> wrote:
> Hello All,
> 
> I'm doing a little research. I need to pull some dynamic content off
> some sites that don't offer XML data of RSS. So I can't go about it that
> way.
> 
> I'm wondering, from a theoretical sense, it is possible to write a php
> application that could log into site, supply the necessary post
> information (i.e. search criteria, etc.), and then parse the results?
> I'd be going to the same site and I could somewhat depend on format.
> It's just that the site admin isn't interested at this point in
> developing an XML app I could tap.
> 
> Practically speaking, I worry about things like sessions, SSL, supplying
> that POST and GET data, etc. Has anyone ever done anything like this?
> I've seen some static page and URL parsing on the list, but I'm talking
> about something a bit larger (almost like a PHP based web browser
> thingy...) I'm just looking at possible solutions now, any ideas? Any
> resources would be great, I really don't mind reading other people's
> experiences...
> 
> Thanks,
> 
> -Flint
> 
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> !DSPAM:40eecc5a7186397312192!
> 
> 


-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

--- End Message ---
--- Begin Message ---
Hi everyone,

I'm porting an application to an iis server. There is a login process on the app which looks like this:
enter username & pass into a form ->
submit to a login script which verifies user/pass
on failure -> go back to login form
on sucess->redirect to wherever the login form wants to go (there are several different logins, all using the same verification script)


the login redirect looks like this:
        if(!$redirect) $redirect = HOMEPAGE;
        header("Location:".$redirect);

pretty simple right? my issue is, the login works and the redirect to the new page is made. however, the url of the new page as listed by the browser is the same as the old url of the login script. to be specific:
the login form is located at "/user/index.php"
the login script is located at "/lib/login.php"
the final page (where you are redirected upon login) is at "/user/home.php"


when the login succeeds you find yourself correctly at "/user/home.php" except the browser still lists "/lib/login/php" as the current url even thought the content reflects "/user/home.php". This has the unfortunate effect of breaking every relative link on the user home page since the browser thinks it is in the wrong directory.

has anyone run across this before? is there a different iis redirection method?

Thanks very much for any help,
-jonathan

--- End Message ---
--- Begin Message --- Jonathan Kart wrote:
Hi everyone,

I'm porting an application to an iis server. There is a login process on the app which looks like this:
enter username & pass into a form ->
submit to a login script which verifies user/pass
on failure -> go back to login form
on sucess->redirect to wherever the login form wants to go (there are several different logins, all using the same verification script)


the login redirect looks like this:
    if(!$redirect) $redirect = HOMEPAGE;
    header("Location:".$redirect);


Perhaps I would not assign the home page to $redirect, just play with an else. Also you forgot an space betwen the colon and the URL.


After a Header, if you do not want anything else to be executed, its a good practice to write an exit.

My proposed code:

<?php
    if (isset($redirect)) {
        header("Location: $redirect");
    } else {
        header("Location: /user/home.php");
    }
    exit;
?>

Hope this helps
Regards,
Jordi.

--- End Message ---

Reply via email to