if you can edit the main php.ini file, change the option to on:
then reload the phpinfo page to see if it applied. The location of the file is defined in the Configuration File (php.ini) Path of the phpinfo view. If you cannot edit the main php.ini, you can try to create a new php.ini file in the document root. And just add the options you want to change. The Loaded Configuration File field of the phpinfo view should show if the new file is loaded.
Note: some times, the configuration (of PHP or of the web server) does not allow to override the settings through custom php.ini files, so you may need to contact your hosting support to make changes.
IMHO it's best printing the name on the usb case and let the client reuse the drive. Otherwise you have to change the firmware of the usb to act like a CD, see if this helps: https://superuser.com/a/822578
I was just curious to learn why anyone would bother using the long version if the short version can do the same job. file_get_contents() using a URL is not guaranteed to work in all situations, as it depends on a configuration setting to allow it to use HTTP (which is sometimes disabled for security reasons) ...
It happens because allow_url_fopen is set to false, in case curl is not available you can also use sockets or fsockopen() & co.
Also, file_get_contents() allows more complex requests, in fact, it can make POST requests, by using the resource context parameter. The same can be done by file(), readfile(), fopen() and in general by all functions that support streams, an example:
However there is still an issue. In the form there are some checkbox, by default if none are selected, the checkboxes will not be set by the browser and so the POST array will miss them. So, if your forms has fields for two identities (Person1, Person2) and you select only Teacher for Person2, you will get role => Teacher. Value, that according to the loop, will be associated to Person1, not to Person2, as expected.
All my other scripts (mysqli and procedural) worked like this:
So, why didn't it tonight ?
Why it only worked with oop style ?
if(TRUE === $conn->query($sql))
Is it because most part of the script is oop ?
No, it happens because $sql is a string, you could either do:
$sql = mysqli_query($conn, "INSERT QUERY HERE");
With the procedural then your IF statement would work fine:
as the result of the query is assigned to the $sql variable. In my example I just skipped the assignement to a new variable an ran the query directly in the statement. It's the same.
it is not actually dumping just the url I am visiting but more. Infact, it's logging other links on my visited page.
Is it because the browser called those links to load the images (even though I did not click them) ?
Yes, the proxy is rewriting all the urls, so the browser is going to request them through the proxy script, it's the same list that you get through the Network tab of the Developer Tools.
and one link twice ?
It happens because there is a redirect with status code 301 or 302, then it reloads the page with status code 200, so the script log its boths.
If you were in my position, how would you code it so the img or video links (that are residing on the visited page) ...
Sorry, but tracker.php what should do? It's the same code of test.php? Then just rename the file. If it's different and you want to send people from script A (test.php) to script B (tracker.php), you just need a form whose action points to script B, but then what is the role of the proxy here? Once you are on the tracker script, the proxy won't work anymore as the execution is completed. If you want to mix the proxy with the tracker then rename test.php to tracker.php and include your tracking code inside this file.
I have already suggested where you can place the tracking code.
Also consider that you don't need a form to initialize the proxy script, just append a link to the file name with a ? and it will work fine. Anyway, see if you get other replies. Bye.
in addition to Andris, the first 16 lines are useless, because it makes a request to google and it does not use it. Line 21 ($url) is not used by the following code, so curl sends a request to the homepage not to the search. Even by changing that, to run the query and set an additional fake user agent, it will hit against a robot check:
To discuss automated access to Amazon data please contact email@example.com.
For information about migrating to our APIs refer to our Marketplace APIs at https://developer.amazonservices.com/ref=rm_c_sv, or our Product Advertising API at https://affiliate-program.amazon.com/gp/advertising/api/detail/main.html/ref=rm_c_ac for advertising use cases.
or status code 503 from CloudFront. Why? Try running the link you want to access through the command line curl:
HTTP/1.1 301 Moved Permanently
which means you have to add a curl option to follow redirects. Would now work? Yes, but it probably won't return results because this part of the pattern ._AC_US_160_.jpg, in the preg match expression, is not pointing to what is currently returned by Amazon results page. So, you can:
open the source page and verify what is in use and hard code the change
or modify the pattern to be more flexible to code changes
in your current code it returns what is in the scr and in srcset attributes, so you can get an extended list of links for each entry and you could apply another ...
in practice you want to log the $url variable. Between line 202 and 246 the scripts initialize the variable, verifies if the url format is valid and finally it attemps to contact the server. Now you have to decide at which step you want to log, for example if you want separate logging for successful and failed requests do it after line 246, i.e. after this line:
$response = makeRequest($url);
and use the responseInfo index returned in the $response array to log the differences.
Notice: Use of undefined constant RETURNTRANSFER - assumed 'RETURNTRANSFER' in C:\xampp\htdocs\test\curl.php on line 27
Warning: curl_setopt() expects parameter 2 to be integer, string given in C:\xampp\htdocs\test\curl.php on line 27
The notice tells you that RETURNTRANSFER is not defined. The PHP engine in this case makes an assumption: you probably meant to use it as a string, so it dress the constant with quotes and serve it to the code.
The warning is just curl_setopt() complaining because, by consequence of the PHP engine assumption, received a string, when it was expecting an integer. So, have you checked if, among curl constants, there is something like RETURNTRANSFER?
Those are definitions of the same function (hcf), the first line is defining a default in case the second argument is 0, in that case returns the first argument (a). Why? Because if you run mod 1 0 you get an exception:
*** Exception: divide by zero
In haskell there are partial and total functions, mod is partial, as it returns an error in case the argument is not a valid value. By defining the default for 0 you cover that error. See: