I want to create an application, either web or windows , is it possible to store the links of website which user of the system visits the sites and the may use any browser, if it is possible , please give me suggetion, how to do it?
How to know whether the server has no data while reading the response of a request which is keep alive because the socket read function waits for the server to send data if we have made a request with keep alive option.
I am writing a socket program to fetch a webpage.
My request header has no connection close header so by default the connection is keep alive.
I open a connection, send the request header using socket_write and getting using a while loop to receive data
if it is a Connection Close request the everything works well.
if it is keep alive and after i have read the content the socket_read function is still waiting for data which causes the code to hand in there.
Here how do we know whether the server has completed sending the resource though it is keep alive...
i have a work around like checking the content-length response header to know how much data is received and accordingly i can stop reading
if response header has transfer-encoding as chunked then i can write more code to find the end of the response
yet without the above two workarounds how to check whether the socket_recv is still waiting for data?
Besides, i was thinking that since we are setting the read buffer length (like 1024 in this code) and the socket_recv is returning the no of bytes read and if the bytes read is less than 1024 then i can assume that the next read will not return anything and by this time i can quit the while loop.... BUT http server sends different length response so my logic will not work.
Here is my request header and the while loop in which i receive date from the server
//i have commented the connection close header so that by default it will be keep alive
$o = 'GET /search?hl=en&q='.$query.'&start='.$start.' HTTP/1.1'."\r\n";
$o.= 'Host: www.google.co.in'."\r\n";
$o.= 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0'."\r\n";
//$o.= 'Connection: close'."\r\n";
//writing $o to the socket resource
//receiving the response
$bytes = socket_recv($f, $tbuf, 1024, 0x40);
if($bytes === false)
die("\r\nUnable to read headers - ".socket_strerror(socket_last_error()));
In the above code after i have received the complete html of a webpage the control is in the line where i am reading the response. Which i assume the code is still waiting for data from the server.
Hello guys, I need to use Google image with my own program. When I save the WWW.image.google.com I am not able to see the camera Icon beside the search button. I need this camera icon to click on it automatically.
can anyone tell me what is the nature of this camera icon!? is it a button or just a clickable icon!?
Thanks and regards
Thanks, I wanted to do the image searching in an automathic way so I just was not able to find the button when i saved the page. Using the advices from other friends in this webpage, I found that the camera is just an icon and behind it there is a href which addresses a java scrips code.
So thanks every one for help
I've problem with send email using php. I used this code:
$mail = new PHPMailer();
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the server
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "email@example.com"; // GMAIL username
$mail->Password = "mypassword"; // GMAIL password
Thank you for your previous answer.. I've tried your idea but it is still not working with error message:
"SMTP -> ERROR: Failed to connect to server: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (118706120)
SMTP Error: Could not connect to SMTP host. Mailer Error: SMTP Error: Could not connect to SMTP host."
What do you think?
Ok, basically doesn't matter, it works anyway but I like to have my HTTP verbs used the right way.
Since ever I've been using GET to handle all the data pulling actions. So everytime I need to pull data from the server I use a GET, everytime I push data to the server I use a POST.
Yesterday I had this discussion with a guy that argued that search operations (like an AJAX request that implements a grid filtering mechanism) must be a POST because it doesn't return a resource... (I really couldn't understand this answer... I tried to but it was impossible to make him explain to me what it meant by that in other words)
Search operations, for me, naturally fit in the data pulling logic. Although it may be filtered data, and we may need to pass a bunch of filter options to the server, the operation itself is to retrieve data from the server.
On your answer you actually give me one more reason why a search should be a GET (for bookmarking).
Although this is not the case, is for internal ajax requests handling, but the same concept still applies.
The only circonstance I can imagine using a POST instead of a GET on this is it the data to be passed to the server is such that there's a chance of overloading the URL max size standards. Otherwise, its a GET!!!
Not a real answer, but a bit more info. I saved your source and looked at it with Chrome21 and FF15. In print preview, FF gets it right but Chrome behaves as you describe.
Me, I'd be tempted to use CSS rather than inline styling. Then you can use media-specific stuff to control screen and print styling independently.
Did the research I should have done before posting. I looked at one of my sites where I have alternate divs styled background-color:#EEEEEE and it's the same - browser views and FF print preview good, Chrome print preview broken.
So it looks to not be related to where the style is set. But again, I haven't got any @media print styling on that page.[/edit]
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
I'm new comer in development web with jquery. I've problem when I developed my web using jquery. My case is I use two ajax in one jquery that defined in file A. In file A there are dropdown menu and button. the first ajax is triggered when dropdown menu is changed. And then ajax call html from file B. so html in file A replaced by html from file, and now the button coming from html in file B. Dropdown menu html isn't replaced by html from file B, after that I clicked that button, but ajax not triggered. Does anyone have problem with me? Please help me for this matter...
we have started a very new company.
and got some customer as well for website development.
Now I am confused, from where to buy hosting space.
Local hosting will be good or internet websites.
Where I will not face any user complain.
and how much it will cast in average?