And to extract (unzip) the file use the following code:
[PHP]<?php
exec('unzip file.zip');
?>[/PHP]
User Profile
Collapse
-
OK I found the answer my self.
Here is the code to download a file:
[PHP]<?php
$foo = system('wget http://www.domain.com/file.zip',$outp ut);
?>[/PHP]Leave a comment:
-
Download and Extract zip file
HI,
Is there a php function that can be used to download a zip file from a different server and then extract it to a specific location on my server?
I want to run this file in cron so it works automatically.
Thanks -
Anybody has any idea about this? There should be a way to fix this problem?Leave a comment:
-
Missing xml opening tag
I have a process.php with the following code:
[PHP]<?php
$xdoc = new DomDocument;
$xdoc->Load('1.xml' );
$test = $xdoc->save("2.xml" );
?>[/PHP]
It should load 1.xml file, and saves it as 2.xml.
Here is my 1.xml file:
Code:<?xml version="1.0" encoding="UTF-8"?> <products> <product> <sku>10001</sku>
-
Get XML data and convert to PHP variable
I have a XML file that looks like this:
Code:<?xml version="1.0" encoding="UTF-8"?> <products> <product> <sku>10001</sku> <qty>3</qty> <price>822.51</price> </product> <product> <sku>10002</sku> <qty>1</qty> <price>320.86</price>
-
Count Elements in XML using PHP
I have a XML file that is automaticaly generated from a database. It contains variable numbers of <product>.... .</product> element.
How can I count number of "<product>..... </product>" elements in php?
Thanks -
PHP Loop with appendChild for XML
I have a XML file with multiple <product> ... </product>
I want to have a php file that adds a child to each product.
I'm using the following php code for this:
Code:<?php $xdoc = new DomDocument; $xdoc->Load('test.xml'); $product = $xdoc->getElementsByTagName('product')->item(0); $newElement = $xdoc ->createElement('store'); $txtNode = $xdoc ->createTextNode
-
Button points to a record in form
I have a MS Access database with multiple forms for data entery. All the data are stored in one table, but I have multiple forms to organize the data entry. I also have a main form that shows the record and has buttons linked to other forms for data entry. Clicking on each button will take you the form to enter the data.
So, here is what I have:
Main form with some minor information about a record (ID, name) and all the buttons,... -
select from three tables and WHERE statement
I have a feeling that this is an easy question. However I'm a newbee and don't have any idea how to do this.
I have three tables that stores my users information. Each user has a unique ID that is same in all three tables and is the way that connects the data for the user.
Table1 has userid and useremail
Table2 has userid and status
Table3 has userid and name, email, phone number and .....
user status... -
Dependent dropdown list with mysql
Hi,
I have two dynamic drop down lists: State and City.
What I'm trying to do is first I need the city list to be empty on load. Then after a visitors selects the "state" from the first list, the page reloads and it shows all the available cities from my database where state is selected.
Here is what I have sofar:
[CODE=php]
<?php require_once('C onnections/myConnection.ph p'); ?>
<?php... -
I get multiple Undefined variable error messages.
Notice: Undefined variable: customer_email_ address in F:\USERS\userna me\www\live\for ms\registration \success.php on line 177
Notice: Undefined variable: customer_full_n ame in F:\USERS\userna me\www\live\for ms\registration \success.php on line 173Leave a comment:
-
I did that but same problem, still not connecting to the table.
I also tried with out quotes, but no luck.Leave a comment:
-
Error when using a variable to select database table
Hi,
I have a script that I need to use a variable to select the database table that I want to update or to get the results from. But for some reason when I use the variable I get error. If I replace the variable with the table name, it works fine.
Here is the part of the code related to this issue:
[CODE=php]<?php
$memberID = $_GET['cm'];
if ($memberID < 50001)
$data_table = 'new_members'... -
Excellent,
Thank you so much. You guys rock.
I am adding your site to my favorites.Leave a comment:
-
Show/Hide Span based on form dropdown menu
Hi,
I'm new to JavaScript.
I'm trying to have a span on my form to sho some detail about the form element when the visitor is entering data. I need this to change based on the drop down menu selection. Here what is I have done sofar, but for some reason it is not working:
[CODE=html]<form action="">
<select onchange="if (this.selectedI ndex==1){docume nt.getElementBy Id['box1'].style.display= 'block'}else...
No activity results to display
Show More
Leave a comment: