This is my current code:
$directory = "polls/";
$dir = opendir($directory);
while (($file = readdir($dir)) !== false {
$filename = $directory . $file;
$type = filetype($filename);
if ($type == 'file') {
$contents = file_get_contents($filename);
$items = explode('¬', $contents);
echo '<table width="500" border="1" ...
Hello all,
I am trying to create a CSV file. I have done this. I have put the below in a loop with the first and last lines outside of the loop.
$FileHandle = fopen('tech.csv', 'a+') or die("can't open file");
$stringa = $item." , ".$item2."\r\n";
fwrite($FileHandle, $stringa);
fclose($FileHandle);
However, it comes out like this in ...
Im using this PHP to display the contents or text files held in a directory, the text files all follow the same format.
$contents = file_get_contents($filename);
$items = explode('¬', $contents);
echo '<table width="500" border="1" cellpadding="4">';
foreach ($items as $item) {
echo "<tr><td>$item</td></tr>\n";
...
Hello all,
I am running PHP version 5.3.0 and Apache: 2.2.11
When I run PHP scripts that consume a lot of memory (I think) - large loops etc. My Apache web server reports a crash?!
[Sat Jan 02 00:51:30 2010] [notice] Parent: child process exited with status 255 -- Restarting.
Do I need to increase memory somewhere? I currently have ...
I have a standard form on poll.php:
<form method="POST" action="createpoll.php">
..blah...
</form>
Is there anyway to process the form without leading the user to createpoll.php, something like calling createpoll.php on submit?
...
ive got a date in this format:
2009-01-01
how do i return same date but 1 year earlier?
...
I've done a lot of searching on this, so please forgive me if I've missed it, but this seems to be pretty unique.
I've got a table in a form that I need rows (and fields) to be dynamically added, and then I need jQuery to manipulate some of those fields, and then they must be passed off to PHP to be dumped into a MySQL database.
I've g...
Hello I am looking to build a basic API and application/apps system on my social network something like Facebook or other sites have, my site is in php/mysql. Here are some questions.
1)
Basically what I want to do is give a user a API key and secret. After I have these how can I use them in my php app to authenticate a user request ...
I encounter a very strange problem with ixwebhosting.
I am able to send email using the php mail() function with $subject = "test";
But if $subject = "testing of information send"; then i won't be able to receive any email
But actually "Mail sent!" was displayed in the php page.
if (!mail($email, $subject, $body, $from)) { echo "Erro...
$result=mysql_query("SELECT * FROM users WHERE pass='".sha1($_POST['mainloginpass'])."'");
if(mysql_num_rows($result)==1){
it says that "mysql_num_rows() expects parameter 1 to be resource, boolean given"
...
Is it possible to know in which file the object is being initialized?
For example, I want to prevent the class from running if it's in X file. I know it defeats the purpose of being re-usable, etc etc. I don't know if it's possible in PHP or possible at all.
...
Hi all,
I am stuck with the following query, which won't order by it's date. Any help, or insight into what I am doing wrong will be much appreciated. The query is supposed to get an entry by thread_id, and then show the newest post in the thread, much like with a forum post, which it does fine. But when I try to order the results from ...
From what I can tell, a SimpleXMLElement is just an array of other SimpleXMLElements, plus some regular array values if there wasn't a tag nested in another tag.
I have a SimpleXMLElement in a variable $data, and var_dump($data) gives me this:
object(SimpleXMLElement)#1 (33) {
["buyer-accepts-marketing"]=>
string(4) "true"
...
...
...
Hi Friends,...
I am new to php, i have some problem in php page. This page contain one while loop, in that loop itself taking record from data base, it showing taxt box, list box like this,,,etc..Here php page while loop contain more then 5 records. here i need to select list box value to pass post to set session in next page. From that ...
hi
I want to customise google check out page . Ie , I want to place my logo in google check out page that will appear when i clicked google check out button in my site this is the place order page . Is it possible to customize the google check out place order page ?
...
Is it possible to access data in other users sessions than the sessions which is active with the currently connecting client ($_SESSION)?
If so, how?
...
I am working on building an REST API in PHP, I need to know if it's possible to to POST an array of methods/functions and params to my api script and have my code run the listed functions and print to the screen an array that the functions produced, example if a user sent a request to get a list of 5 photo url's it would post a PHP array...
Hi
i want a text box in my html page , But i would like to it become a multi line text box . Is it possible in html ? i don't want to use Textarea ,,
...
I need to generate the following XML with SOAP:
...
<InternationalShippingServiceOption>
<ShippingService>StandardInternational</ShippingService>
<ShippingServiceCost currencyID="USD">39.99</ShippingServiceCost>
<ShippingServicePr...
I am filling DropDown dynamically using AJAX. The DropDown code looks like this:
<select class="element select medium" id="inDistrict" name="inDistrict" onclick="MakeRequest('divDistrict', 'inDistrict', 'SELECT * FROM districtmaster');" onchange="alert(document.getElementByID('inDistrict').value);">
<option value="Select" selected=...