php

string sanitizer for filename

I'm looking for a php function that will sanitize a string and make it ready to use for a filename. Anyone know of a handy one? ( I could write one, but I'm worried that I'll overlook a character! ) Edit: for saving files on a Windows NTFS filesystem. ...

Possible methods to send the output of a PHP-invoked .exe program (that runs as a separate process, not in PHP) back to the iPhone client

My iPhone client app uploads a data to the server, which runs on PHP. There is a code to invoke a .exe program on the server side on PHP. The .exe program will take the uploaded data and run on a process on its own. That means the PHP execution will end without waiting for the .exe program to finish. After the .exe program finished proce...

Login using Flex and PHP but how to handle session

Hi, I have a Flex login page that uses HTTPService to communicate with server side php script. Once user's credential is verified, a session will be created and the login page will redirect to the main Flex page with that session info. I'm not sure how to implement the session logic. Can someone shed some light on this? Some sample cod...

How to use jqGrid Advanced Search /w Serverside PHP?

Hi guys,   I've been playing around with jqGrid but cant work out how to implement the search functionality. Ideally I'd like to use the 'Advanced Search' - I imagine that when the user submits the advanced search form, the entered data is fired to the url specificed under 'editurl'? Im guessing this URL then outputs the resultset filte...

Is my implementation of HTTP Conditional Get answers in PHP is OK?

After searching a lot, reading every tutorials I've found and asking some questions here, I've finally managed to answer corrctly (at least I think) to if-none-match and if-modified-since HTTP requests. To do a quick recap, this is what I do on every pages cacheable: session_cache_limiter('public'); //Cache on clients and proxies sessi...

Strange email format attachement encodnig

Here is sample of email attachemt, it opens OK in Outlook express, but i really don't know how to decode this to useful data (it's .csv file) with php? begin 664 AGI_NAV_PERF_20100107.csv M4D507T1!5$4[25-)3CM&54Y$4U].04U%.TY!5E]015)?4TA!4D4[4D5455). M7S%$.U)%5%523E]95$0[4D5455).7S%9.U)%5%523E\S63M354)30U))4%1) M3TY?1D5%.U)%1$5-4%1)3TY?1...

Get Noun,Adj,Adv with PHP

How to get english other states when I enter 1 state. I mean I have a noun and I want to get other adjustment. $word_list=get_list('play','n'); and then I want to get v , adj, adv, etc.,.. ...

PHP preg_replace weirdness with custom urls

LS, I'm using the following code to add <span> tags behind <a> tags. $html = preg_replace("~<a.*?href=\"$url\".*?>.*?</a>~i", "$0<span>test</span>", $html); The code is working fine for regular links (ie. http://www.google.com/), but it will not perform a replace when the contents of $url are $link$/3/. This is example code to show ...

Make javascript run on external link click?

Ok, lets say I have page.php. If i'm currently viewing page.php and I click this link: <a href="#?call=friend.request&amp;user_id=10&amp;width=420&amp;height=250">Link</a> The javascript box will pop up. Success! However, if I'm on a different page, and I link to <a href="http://domain.com/page.php#?call=friend.request&amp;amp;user...

Extract information from Apple App Store

Does anyone know how to extract the title, cost, description and icon for a list of apps from the App Store? I have seen various sites do it, ie. link text. I do not need all of the apps, just 30-40 different ones, mostly from the education category. Also if possible is there a way to dump it into a MySQL database? Thanks! ...

PHP Web Application: mysql database design best practices question

Hi All, I am currently in a debate with a coworker about the best practices concerning the database design of a PHP web application we're creating. The application is designed for businesses, and each company that signs up will have multiple users using the application. My design methodology is to create a new database for every compa...

Can I avoid to overwrite a column with a NULL value on INSERT query?

I have two different queries in my php page for the same table, the first one is executed if I have two different values for two columns, but in some case, i can use only the first value, can I do it with the same query or should I use two different queries? // query 1 "INSERT INTO my_table (column_1, column_2) VALUES ('$value_1', '$val...

Need help from a Phplogin (from roscripts) user

Hello, I've bought a year ago a license of PHPLogin v2.0.6 from roscripts.com. The guys from roscripts have sold their business, and now there's no support what so ever from them. So i'm hoping someone here could help me with this : I've created a specific users groups, but i don't know how to tell the script that i want all the peop...

problem with PHP server in eclipse

I want to run a PHP file as a web page in Eclipse, but every time I try to run it, I get a "404 not found error". I'm using the default PHP Web server in the run configuration. Here's a screenshot of how I got it configured... What am I doing wrong? Thank you ...

Solution for loading large JQuery image gallery

I'm upgrading some image galleries on a university website (needs to be standards compliant, to some degree). Most galleries are many pages of HTML. I've been using the jQuery plugin, Galleriffic, as well as some PHP code I wrote, to generate nice paginated galleries, and it looks great so far. I have two problems though. The first prob...

MySQL query is creating a duplicate row

I have never encountered an error like this before. I was using prepared statements when it stared and have tried everything to correct the problem including stripping the form down to it's bare components. The following code, when executed, is creating a duplicate row. $sql = "INSERT INTO inventory VALUES ('','$stocknum','$y...

can i use stdClass like an array?

is it possible to make stdClass objects work like a generically indexed array? i.e. $array = Array ( [0] => 120 [1] => 382 [2] => 552 [3] => 595 [4] => 616 ) would be constructed like $a = array(); $array[] = 120; $array[] = 382; etc. but if i do that with an object it just overwrites itself: $obj = new stdClass; $obj->a = 120; $...

Using ISSET function in PHP

I have the following code to ensure that the form does not have any unfilled textboxes and selected boxes $required_fields = array ('menu_name','visible','position'); foreach($required_fields as $fieldname) { if (!isset($_POST[$fieldname]) || empty($_POST[$fieldname]) ) { $errors [] = $fieldname; } } Where menu_nam...

verify email opened

once we send email from php using mail() function, is there any way to check either mail is open or not? may be any type of database insertion code in email..? or calling any function from website? any possibility......... i search on internet all the day but did't found any ans. Thanks ...

CSV files and multi line text cells

Hi, I am generating a simple csv file using php. The file contains some user's personal data. When I open the generated file in office, the addresses are not displayed in full height. I have to double click on the cell for the address to be shown fully (in full width and height) otherwise I can only see the first word/number of the addre...