mIRC Homepage
Posted By: igotnonick sockopen .php(s) - 23/03/06 08:58 PM
Hi ppl.
i can't logon the site and retrive data?
did i did anything wrong?

Code:
alias sq sockopen sq www.thesimpsonsquotes.com 80
on *:sockopen:sq:{
  sockwrite -n $sockname GET /random.php?num=1 HTTP/1.1
  sockwrite -n $sockname Host: thesimpsonsquotes.com $+ $str($crlf,2)
}
on *:sockread:sq:{
  sockread %data
  echo -s %data
}
Posted By: bwr30060 Re: sockopen .php(s) - 23/03/06 09:26 PM
Quote:

HTTP/1.1 301 Moved Permanently
Date: Thu, 23 Mar 2006 21:25:22 GMT
Server: Apache/2.0.46 (Red Hat)
Location: http://www.thesimpsonsquotes.com/random.php?num=1
Content-Length: 347
Connection: close
Content-Type: text/html; charset=iso-8859-1
Posted By: igotnonick Re: sockopen .php(s) - 24/03/06 12:20 PM
HTTP/1.1 301 Moved Permanently
Date: Fri, 24 Mar 2006 12:19:37 GMT
Content-Length: 347
Content-Type: text/html; charset=iso-8859-1
Server: Apache/2.0.46 (Red Hat)
Location: http://www.thesimpsonsquotes.com/random.php?num=1
Via: 1.1 supercache2 (NetCache NetApp/6.0.2)
-
* /echo: insufficient parameters (line 81, script21.ini)
-
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://www.thesimpsonsquotes.com/random.php?num=1">here</a>.</p>
<hr />
<address>Apache/2.0.46 (Red Hat) Server at thesimpsonsquotes.com Port 80</address>
</body></html>
Posted By: FiberOPtics Re: sockopen .php(s) - 24/03/06 12:26 PM
sockwrite -n $sockname Host: www.thesimpsonsquotes.com $+ $str($crlf,2)
Posted By: igotnonick Re: sockopen .php(s) - 24/03/06 02:05 PM
special thanks fop. i missed this crazy
Posted By: Dr_Brom_sung_ Re: sockopen .php(s) - 25/03/06 08:29 AM
also change the:
echo -s %data

to

if ($remove(%data,$chr(32)) != $null) echo -s %data


This way you will not create an error!!!
(You can also just put :error after the echo command so you will just not see the error and it will not halt the script, assuming that you will add more lines after the echo)
© mIRC Discussion Forums