php

How to generate RTFs with PHP

I need to generate an RTF from within PHP. I've seen several libraries out there but wondering if anyone has used any of them or if they've just hand coded their own (which I'm perfectly able to do). Any opinions out there? TIA ...

Is there a way (In PHP) of detecting if the script was called by jQuery load or not?

I'd like a script that could detect if called by jquery If not, it'd display the page+layout, if not, it'd just so the content (but that is irrelevant) But yeah, a way of detecting if it was called by jquery load - ajax - or directly requested. Cheers! ...

Best way to deploy codeigniter-like web application

After reading similar posts on deploying applications with Capistrano, I decided to give it a try with no success. Mostly because I can't get ruby on my hosted server. I then found out about Fredistrano. After tweaking its awkward .htaccess problem (adding RewriteBase helped) I got it to run. Now, I have the all-time problem of updating ...

Finding/Handling stalled PHP scripts

I use Ajax to kick off a PHP script that can take a few hours to run. It's done asynchronously so the PHP script will complete even if the browser is closed. I need to handle any of these PHP scripts that have stalled/hung for whatever reason. What is the best way to go about this? Is there a way to get a process id for the PHP scrip...

Post to twitter using oauth with from

I am unclear on how to post to twitter using oauth. Please do not just post a link on this page for me to look at because chances are I have already seen it. I have the section where they go to twitter and approve the app and come back to my site. I then store the information in access key and access secret key in the database from the u...

one to many queries

Alright, I've just finished normalizing a table. What I didn't really consider when I was doing it is that I now have a one to many relationship... being that my sql knowledge is very, very limited I'm not really sure how to approach this. I tried grouping by the foreign key, but it only returns the last matching result and I want to re...

How to get the OS on which PHP is running?

For building a unix/dos specific script i need to know on which kind of operating system i am. How do i get this information? phpinfo(); tells me a lot more and not very clear whether im running on unix or not. ...

Thoughts on creating a view selector in php

Hey all, I'm looking to create a nice way to separate view and controller in php. What I'd like to happen is people would go to: localhost/index.php?view=signup and they would see the whole page with a signup box.. and NOT a login box. I'm wondering if anyone has made this before.. I'm specifically looking for a elegant way of lettin...

I would really like to use PHP and MySQL persistent connections, but how?

Apache/PHP/MySQL persistent connections have such a bad reputation because Apache handles each request as a child php process, each having 1 persistent connection. When visitors scale, MySQL reachs max connections limit from all the apache/php child processes, each with 1 persistent connection. There's also the issues of temporary tables...

php shopping cart need advice

I am shopping for a shopping cart(no pun intended), few requirements: php written supports several method payments: visa, mastercard, paypal easy integration well tested and stable html could be edited to make it look like a part of web site what are the big ones out there to use? ...

Css style not applying in Internet Explorer, but works well in firefox

I am trying to apply css to php code. But it not working well in Internet Explorer, But working fine in firefox Code : echo '<div class="resultno">'; echo "<td>" . $row['stu_id'] . "</td>"." "; echo '</div>'; echo "<td>" . $row['Name'] . "</td><br>". " "; echo "<br>"; And it looks like --> http://www.flickr.com/photo...

Basic web-crawling question: How to create a list of all pages on a website using php?

I would like to create a crawler using php that would give me a list of all the pages on a specific domain (starting from the homepage: www.example.com). How can I do this in php? I don't know how to recursively find all the pages on a website starting from a specific page and excluding external links. ...

Replacing substring in a string

I am uploading a image file to the server. Now after uploading the file to the server I need to rename the file with an id, but the extension of the file should be retained. Eg: if I upload the file image1.png then my server script should retain the extension .png. But I need to change the substring to some other substring (primary key ...

SQL query is only retrieving first record.

Hi, I have a query which is designed to retireve the "name" field for all records in my "tiles" table but when I use print_r on the result all I get is the first record in the database. Below is the code that I have used. $query = mysql_query("SELECT name FROM tiles"); $tiles = mysql_fetch_array($query); I really cant see what I have ...

How to disable php language extension (eg. abc.php.fr) ?

by default apache will load php interpreter with .php extension. Somep\how php interpreter also called with this kind of extension .php.fr . How to disable this language extension? ...

geting a list of all files in a directory

I want to do following 2 things 1)i want retrive the list of all files in a directory 2)and then i want to remove their extensions eg: if i get a list of fils as A.png ,B.png,C.jpeg,D.txt I want to get A,B,C,D How do i do that in php? ...

mysql_connect() works fine on localhost but not when accessing seperate ip...

Howdy everyone! I'm working with my University's Systems Administrators to get a LAMP stack setup for me. I'll need to access this server from several websites that I'm working on and I'm having some issues. So to keep thing's clear: LAMP Server URL = https://mysqlserver.edu School URL = https://schoolsite.edu When I run mysql_conn...

I get "undefined variable" PHP notice

Hi guys, I'm curious as to why I'm getting an error on something I've done a million times before but am all of a sudden on a certain script getting an error 'Undefined variable: row' Yet row seems defined to me... $sql = 'SELECT * FROM table WHERE id="1" LIMIT 1 '; $res = mysql_query($sql); if(mysql_num_rows($res) != FALSE) { ...

Aptana spell checking

I'm currently using Aptana as an Eclipse plugin and I noticed that when I make a typo in my comments (PHP) that it underlines it with a squiggly line. However, Aptana seems to be smart enough to know that I made a type but I can't find any option to let it make the spelling correction for me (like a right click on the word and to be pres...

How do I retreive all parameters and its values in a URL?

If I have a URL like this: http://www.example.com/?a=1&amp;b=2&amp;c=3 (an example) I am working on a project and want to see what parameters are passing to a URL internally. thanks ...