How to download HTML using PHP?
How do I download an HTML file from a URL in PHP, and download all of the dependencies like CSS and Images and store these to my server as files? Am I asking for too much? ...
How do I download an HTML file from a URL in PHP, and download all of the dependencies like CSS and Images and store these to my server as files? Am I asking for too much? ...
Difficult to explain this Question, but im currently passing variables in a php page to some html hidden inputs. Im fetching those values from the hidden inputs with a javascript function. This function gets called like this: <body onload="function();"> It works on my system now, but is there any chance that the value passed from ph...
Okay I have two pages-- page1.php and page2.php .Both of these pages have select lists.I have posted the values selected by the user to script.php which has them stored in session variables. I need to add the values (which are the ones selected by the user from the select lists in both the pages) and display this total value in page3....
I would like to rewrite this php digital signing function into Delphi code. function SaySig() { $privKeyFilePath = "c:\temp\myrsakey.pem"; $data = "sign this string"; $fp = fopen($privKeyFilePath, "r"); $priv_key = fread($fp, 8192); fclose($fp); $privatekeyid = openssl_get_privatekey($priv_key); openssl_sign($data, $...
Using $('#form').serialize(), I was able to send this over to a PHP page. Now how do I unserialize it in PHP? It was serialized in jQuery. Thank you !! ...
I'd like to run checks to see if a given URL is registered or not. As a simple proxy for testing if it's registered, I was going to check HTML response codes. 200, 300 probably == registered, 4xx probably == not registered. I understand that there might be holes in this logic. My question is if cURL has a way to return the HTML response...
Hey, I want to use php's exec() function on an ubuntu server. The problem is, I alway get an error, that the command is not found. For example using exec("echo 123"); prints sh: /echo: not found To me, it looks like php is using the sh shell, when I want to be using bash. I tried changing the shell for www-data in /etc/passwd,...
I'm using ajax to do some validation on some dates passed (basically making sure that the first date/time occurs before the 2nd date/time, and neither are blank). If I have async set to true, it works, but I get a false positive because it's working at the same time as the rest of my form validation. If I set it to false, then I get an...
I'd like to have a form's data arrive on the server ordered in a specific format as an array. Presently, I have the following form elements which may appear numerous times in my markup: ... <tr> <td><p>Friend's Name:</p></td> <td><p><input type="text" name="friends[name][]" /></p></td> <td><p>Friend's Email:</p></td> <td><p><inp...
I'm trying to find out what the best way would be to have a specification pattern in PHP where the specifications could (optionally) by transformed to PHP. I am exploring some new directions and am testing how well they would work. Code and ideas are still very unclear in my mind. Minimal interfaces would be like these: interface IRep...
This is a really broad question, but I have come across it a couple of times in the last few weeks and I was wondering what the general consensus is regarding good practice and efficiency. 1) SELECT COUNT(*) FROM table WHERE id='$id', name='$name', owner='$owner_id' and then based on if there is one result then the record matches. 2)...
How can I explode a string by one or more spaces or tabs? Example: A B C D I want to make this an array. ...
I've noticed many times where some php scripts exit. It seems to me that this will force an exit of the httpd/apache child (of course another will be started if required for the next request). But in the CMS, that next request will require the entire init.php initialization, and of course just cleaning up and starting php in the first p...
Hi, I'm writing a web application and I'd like to work out what type of browser/OS the request is coming from, and customise the returned content accordingly. So if someone visits the site from an iPhone/Android, they get a more streamlined experience, or if it's a desktop, they get the full version. I will pretty much take a complete...
I have written an admin panel for my site (im beginner in php). In content.php I have insert tinyMCE editor. I want to upload images from editor. What is the best way to do this. (not very familiar with javascript) Thanks in advance ...
this question is similar to this one but with a twist (so the answer accepted for the older question is not valid in the following scenario) i have a site for selling tickets (PHP/MYSQL). Suppose i have just one ticket left: buyer A puts the ticket in her cart and goes to the payment gateway page (ie. paypal) the ticket is locked for...
Hi All, I am trying to display overall ratings on the front of my site and although my site and DB are small now, I think this query and process might bog things down when this table gets large. Right now, I have ratings employed that are easy because my query is saying: find all records for this ID, pull all ratings and average them. ...
I'm new to regex with PHP. How can I find the contents of the first parentheses with a string that is a couple of paragraphs long. I'm assuming I have to use the preg_match function ...
Hi guys, How is is possible, using PHP to add a new index to each 'level' of an multidimensional array? For instance, for the following array: $array = array( 'a' => 'a val', 'b' => array( 'ba' => 'ba value', 'bb' => array( 'bba' => 'bba value' ), 'bc' => 'bc value' ), 'c' =>...
Hello. So I have this output on my page.. not understanding why I have it popping up. I'm new to php though, so maybe it's something easy to fix -I have a header.php file, which includes all important info, as well has the banner of the page. This header.php is included on every page. -I have it checking the session value to make sure ...