Forum Moderators: coopster

Message Too Old, No Replies

where to put this php codes?

         

kingston 123

10:38 am on Jan 14, 2017 (gmt 0)

5+ Year Member



My friend gave me this codes, before using this codes what software should I install on my PC & where to paste this codes to get final result:

<?php
$url = "http://www.google.co.in";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Return in string
curl_setopt($ch, CURLOPT_URL, $url);
$varx = curl_exec($ch);
echo htmlentities($varx);
?>

phranque

10:39 am on Jan 16, 2017 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, kingston 123!

install PHP on your pc, paste your code into a .php file, and use the php command to execute the .php file.

Dimitri

11:47 am on Jan 17, 2017 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



Sorry, but I am puzzled at what you are trying to do... I mean, obviously, you don't know what is PHP, and I am curious as to why your friend gave you such a code, since you don't know what it is, and how to use it ...

By the way, phranque is correct, install PHP [ [windows.php.net...] ] , save your piece of PHP code into a file like "code.php" and execute it from a command line prompt with "php -f c:/path/to/file/code.php" . However, I doubt it's going to give the result you are expecting ...