Hi there!
I have to do a php script that daily surf a webpage (I do it with
crontab) and collect some data.
The proble is that to access that webpage I have to do a login. I have
the login data, but do it via browser....ok, I'm not stupid, but do
that via php script...well I'm not able to do it.
The script is running on the server side, so it's useless to do the
login on my browser prior to run the script.
The page where I have to login has this code in it:
<form name="homesitec control" method = "post" action="/sasa/index.jsp?
epi-content=LOGIN&e pi-
process=home_pr ocess_login.jsp &type=url&form_ url_name=http://
www.xxxxxxxx.xx x/sasa/site/ffds/?epi_menuItemID =5558e3fd3775e0 c3beda0052c0104 1ca&target=top& source=sitecont rol"
target="_parent " style="margin-bottom:0px;">
<input type="hidden" name="realm" value="SQL">
<table width="148" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td class="login">
<table width="100%" border="0" cellspacing="0"
cellpadding="0" >
<tr>
<td colspan="2"><im g src="/images/xxxxxxx/newhome/
login.gif" width="45" height="20" /></td>
</tr>
<tr>
<td colspan="2" class="login_bo x">Username
<input name="logon" type="text" class="login_fo rm"
size="15" maxlength="50">
</td>
</tr>
<tr>
<td valign="bottom" class="login_bo x">Password
<input name="password" class="login_fo rm"
type="password" size="15" maxlength="20" onKeyPress="ret urn
submitenter(thi s,event)"/>
</td>
<td valign="bottom" >
<input name="Invia" type="image" src="/images/
xxxxxxxxx/newhome/login_box_frecc e.gif" width="26" height="17">
</td>
</tr>
<tr>
<td colspan="2">
<a href="http://www.xxxxxxxx.xx x/sasa/site/ffds/?
epi_menuItemID= a2dc1cab4db4465 fb70c3072e02041 ca&beanID=98976 176&viewID=rich iestaPass&epi-
content=GENERIC " class="link_log in_box">passwor d dimenticata?</a>
<a href="http://www.xxxxxxxx.xx x/sasa/site/ffds/?
epi_menuItemID= 61c946e879c833d 632294560c01041 ca"><img src="/images/
xxxxxxxxx/newhome/login_box_regis trazione_it.gif " width="129"
height="19" border="0" /></a>
</td>
</tr>
</table>
</td>
<td width="7"><img src="/images/xxxxxxxxx/newhome/
login_box_dx.gi f" width="7" height="128" /></td>
</tr>
</table>
</form>
How can I do it???
Thanks,
Andrea
I have to do a php script that daily surf a webpage (I do it with
crontab) and collect some data.
The proble is that to access that webpage I have to do a login. I have
the login data, but do it via browser....ok, I'm not stupid, but do
that via php script...well I'm not able to do it.
The script is running on the server side, so it's useless to do the
login on my browser prior to run the script.
The page where I have to login has this code in it:
<form name="homesitec control" method = "post" action="/sasa/index.jsp?
epi-content=LOGIN&e pi-
process=home_pr ocess_login.jsp &type=url&form_ url_name=http://
www.xxxxxxxx.xx x/sasa/site/ffds/?epi_menuItemID =5558e3fd3775e0 c3beda0052c0104 1ca&target=top& source=sitecont rol"
target="_parent " style="margin-bottom:0px;">
<input type="hidden" name="realm" value="SQL">
<table width="148" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td class="login">
<table width="100%" border="0" cellspacing="0"
cellpadding="0" >
<tr>
<td colspan="2"><im g src="/images/xxxxxxx/newhome/
login.gif" width="45" height="20" /></td>
</tr>
<tr>
<td colspan="2" class="login_bo x">Username
<input name="logon" type="text" class="login_fo rm"
size="15" maxlength="50">
</td>
</tr>
<tr>
<td valign="bottom" class="login_bo x">Password
<input name="password" class="login_fo rm"
type="password" size="15" maxlength="20" onKeyPress="ret urn
submitenter(thi s,event)"/>
</td>
<td valign="bottom" >
<input name="Invia" type="image" src="/images/
xxxxxxxxx/newhome/login_box_frecc e.gif" width="26" height="17">
</td>
</tr>
<tr>
<td colspan="2">
<a href="http://www.xxxxxxxx.xx x/sasa/site/ffds/?
epi_menuItemID= a2dc1cab4db4465 fb70c3072e02041 ca&beanID=98976 176&viewID=rich iestaPass&epi-
content=GENERIC " class="link_log in_box">passwor d dimenticata?</a>
<a href="http://www.xxxxxxxx.xx x/sasa/site/ffds/?
epi_menuItemID= 61c946e879c833d 632294560c01041 ca"><img src="/images/
xxxxxxxxx/newhome/login_box_regis trazione_it.gif " width="129"
height="19" border="0" /></a>
</td>
</tr>
</table>
</td>
<td width="7"><img src="/images/xxxxxxxxx/newhome/
login_box_dx.gi f" width="7" height="128" /></td>
</tr>
</table>
</form>
How can I do it???
Thanks,
Andrea
Comment