php

PHP csv functions, Microsoft safe?

Hi there, I have been looking into the php fputcsv function, and have heard some comments that the files created using this method will not work on microsoft excel, is this correct? Comment on php.net since PHP is generally *nix-based, it makes sense that the line endings are always \n instead of \r\n. However, certain Micros...

Browser post profile implementation using PHP

Browser post profile using PHP This is with reference to http://stackoverflow.com/questions/859652/convenient-applications-for-browser-post-and-browser-artifact-saml-profiles I want to implement browser post using PHP. How can I achieve this. Shibboleth modules provides server post profile. How can this be tweaked. Thanks Regards, ...

how to stop refresh on view javasript

Hi, I've created a shout box on my homepage, which refresh every three seconds. I've made it scroll default as bottom, so this box will scroll when the pings are very long. If someone want to see the old pings, they can scroll up. Due to the three second refresh, I can't read my old pings. So I wish to restrict the shout box refresh. W...

Fetching zend resource without knowing type of the resource

It is possible to fetch the zend resources (zend_fetch_resource) without knowing the type of the fetching resource? If so, how? Note: I am writing PHP extension. ...

Can I do this with MySQL or do I need to get PHP involved?

Hi, I have two MySQL tables with a similar structure. i.e. Table_A - Col1, Col2, Col3, Col4, Col5 Table_B - Col1, Col2, Col3 I need to run a query that says something like: SELECT * FROM Table_A WHERE (Table_A.Col1 DOES NOT EXISTS in Table_B.Col3 AND Table_B.Col2 = 'A') AND Table_A.Col5 = 2 etc... So basically I need to select ev...

Output buffering issue; help please

ob_start(); for($i=0; $i < 10; $i++) { echo $i, ' '; ob_flush(); flush(); sleep(1); } Expected: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 appearing incrementally every second in the browser. Result: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 at once AFTER ten seconds. I just couldn't get output buffering to work. ...

The image cannot be displayed because it contains errors.

Hello, Why is this code not working ? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> </head> <body> <?php header('Content-type: image/png'); $myImage = imagecreate(200, 100); $myGray = imagecolorallocate($myImage, 204, 204, 204); ...

insert sql statement into mysql database like common string?

I wrote a logger function and it inserts "insert and update queries" to database. altough I apply "mysql_real_escape_string" to the sql stament, I cannot insert it to the database. any suggestion please? ...

prevent duplicate entry data still no function

dear all. i have tried to prevent the duplicate data at my project. but until now it still make duplicate. i try this code but still not work: $cek_user= "SELECT Model, Serial_number, Line FROM inspection_report WHERE Model='".$Model."' AND Serial_number='".$Serial_number."' AND Line='".$Line."'"; $cek_data=mysql_num_rows($cek_user)...

Need help: Date format

I have birth date data stored in Mysql table as below: id firstname middlename lastname birth --------------------------------------------- 1 Harry Chandra Sihombing 1999-12-14 2 Janice Mona Sihombing 2010-04-20 . ... ... ... ... How can I create a search function to collect data from the ta...

Showing Wordpress posts on two pages

Hi all, I have three pages on my site. Let's call them home, page2, and page3. My 'home' page is set as a static front page. My 'page2' is set up as the blog page. What I want is the following: I want page2 to display blog posts with a certain category (of which ID is known). AND I want page3 to display blog posts with a certain c...

wikiya toolbar and jquery problem

I've recently added the wibiya toolbar to my site. Since doing that, my jquery script stopped working. I've checked their troubleshooting section and did the trick they are suggesting. Now my jquery works, but I am still getting loads of warning messages and the jquery script act a bit weird... Has anyone had the same problem? How did y...

Extracting value of non-selected options from html <select> using PHP

Hi, I have an HTML that uses the following script as described in the first example here: http://www.mattkruse.com/javascript/selectbox/ I want to use PHP to extract the options that are in the right select box. How do I do that if they are not actually 'selected'? Thanks, ...

Get <p> and <br /> tags positions in HTML

Hi, I have to get <p> and <br /> tags positions in whole html code. If I use strpos function, I get only first tag position. Does it possible to make this function greedy or something ? Or maybe there is any other solution(function) ? Your help would be appreciated. ...

How to handle database logic from model

Hi, I created a enterprise system model from a class diagram and converted it php object oriented code. What I have now is just an empty model, it's able to relate and the connections are handled. Now the next step is ahead. I have a database and have to put the object into the database. Now there is a lack of experience on my side. I...

Retrieve n Records From XML FIle With PHP

I'm trying to retrieve N number of items from an XML file using simpleXML and put the information into a 2 dimensional array like: [0][name] [0][image] [1][name] [1][image] [2][name] [2][image] In this case N items will be 6. I'd like to do this two ways, 1. Grab the first 0-6 keys and values 2. Or a random 6 from the xml file. Th...

Need help to make and query cost matrix table?

I had built a website for my client with Drupal 6 . Now he wants to query cost of his service from one town to another town. I know basics of CCK and Views. I will need two select box for towns and show cost of between two towns and a way to let customer enter cost between towns. What is the easiest way of doing it in Drupal ? I am a ja...

How to traverse all sub-folders with special file in it!?

I want to traverse all sub-folders of a particular folder and check whether they have a special file in it otherwise delete the sub-folder. Take this example (file.txt being the special file here): folder_all folder1 file.txt folder2 file.txt folder3 empty Because "folder3" doesn't have the file, I'd like to delete it. And t...

PHP sending mail attachments

Hello, I have a form with <input type="file" name="uploaded_file" /> I found the post about adding attachments to the mail. The question is how to connect uploaded file with that function? What I have to pass? UPD: echo '<pre>'; print_r($_FILES); echo '</pre>'; $uploads_dir = '/uploads'; // It has need rights $tmp_name = $_FILES...

How to get the output of java apps in a php web script?

Hi, I have written a Java application that runs from the command line. I want to allow users to access this via a simple PHP web interface - it'll just allow them to specify certain parameters, and then execute the java app and return the output. For some reason, I'm getting a 'Permission Denied' error message when I try to do anything...