Hi Guys I'm very new to regex, can you help me with this.
I have a string like this "<input attribute='value' >" where attribute='value' could be anything and I want to get do a preg_replace to get just <input />
How do I specify a wildcard to replace any number of any characters in a srting?
like this? preg_replace("/<input.*>/",$r...
In Python I could've converted it to Unicode and do '(?u)^[\w ]+$' regex search, but PHP doesn't seem to understand international \w, or does it?
...
Hi All,
I want to create a file on the webserver dynamically in PHP.
First I create a directory to store the file. THIS WORKS
// create the users directory and index page
$dirToCreate = "..".$_SESSION['s_USER_URL'];
mkdir($dirToCreate, 0777, TRUE); // create the directory for the user
Now I want to create a file called index.php and...
Is it possible to insert a row, but only if one of the values already in the table does not exist?
I'm creating a Tell A Friend with referral points for an ecommerce system, where I need to insert the friend's email into the database table, but only if it doesn't already exist in the table. This is because I don't want any more than 1 p...
errr im not sure if my question's title is clear enough but i'll try my best to explain
i really am not sure about how php executes the function mysql_query in terms of retrieval and storageof strings, does it recognize any character set encodings used in the table?
and does my browser by default overrides any character encodings sent th...
I'm developing an object-oriented PHP website right now and am trying to determine the best way to abstract database functionality from the rest of the system. Right now, I've got a DB class that manages all the connections and queries that the system uses (it's pretty much an interface to MDB2). However, when using this system, I've rea...
Hi
Im subscribed in a mailing list that i use only as reference for developing and im trying to read it with my rss client but the mailing list doesnt provide the rss.
So i thought it should be a way to convert the mailing list to a rss i was trying to find some php class to install it in my server but cant find anyone.
Can you suggest...
What is the best way to password protect quicktime streaming videos using php/.htaccess. They are being streamed using rtsp, but I can use other formats if necessary.
I know how to do authentication with php, but I'm not sure how to setup authentication so that will protect the streaming files urls so that a user can't just copy the url...
In previous applications, I was able to get TinyMCE to work just fine. But in this web app, I get the rich editor to show up okay, but for some reason I cannot type into the rich editor field and when I click a button like for bolding, I get this error:
Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)...
What is the best way to password protect folder using php without a database or user name but using. Basically I have a page that will list contacts for organization and need to password protect that folder without having account for every user . Just one password that gets changes every so often and distributed to the group. I understa...
I need to export a report to Excel file using PHP i.e. on the fly. I am acutally getting data from mysql and presenting it in HTML tables. I am able to export all this data into Excel file format, except images. I can't point the image source to absolute url, because this file also needs to work offline. Is there any way, I can embede/in...
I have a load of user-submitted content. It is HTML, and may contain URLs. Some of them will be <a>'s already (if the user is good) but sometimes users are lazy and just type www.something.com or at best http://www.something.com.
I can't find a decent regex to capture URLs but ignore ones that are immediately to the right of either a do...
How can I match (PCRE) everything inbetween two tags?
I tried something like this:
<!--\s*LoginStart\s*-->(.*)<!--\s*LoginEnd\s*-->
But it didn't work out too well for me..
I'm kind of new to regular expressions, so I was hoping if someone would be kind enough to explain to me how I would accomplish this, if its even possible wit...
Hey folks -
I'm trying to upload an image to my site through a form, however it's much more efficient to (rather than bog down the database) just store the location of the image in the database.
I'm having trouble with my form and really don't know where to go:
<?=form_open('bro/submit_new');?>
//other form data
Image: <input type="...
I want to write a little app for myself which notifies me if there is a new version of php or mysql but I would need a feed or an xml file to read it from.
...
I'd really like to spend more time writing and learning about PHP, so I'd like to delve into the code of some well-written open source projects, and possibly contribute if I became familiar enough with the code. I know everyone says you should pick something you use or enjoy, but all of the open source PHP applications I've used have bee...
Even though error_reporting is set to 0, database errors are still being printed to screen. Is there a setting somewhere I can change to disable database error reporting? This is for CodeIgniter v1.6.x
EDIT: Re: Fixing errors - Um, yes. I want to fix the errors. I get error notices from my error log, not from what my visitors see printe...
I want to use Google's Annotated Time Line Visualization. It is very easy to make this work by manually adding the lines for column & row data. This is all done through attributes of google.visualization.DataTable(). I would like to update this data table dynamically, but I do not know how. The data is on a server running MS SQL Server ...
I am getting
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result
resource in *filename* on line 81
While running a query to build a chart. The query gets data from the mysql db and uses it to build the chart.
Usually, I get this error and go to the code and find where I've screwed up, fix it, and move on. ...
How would I go about creating a real world form creation class that I can use to display a new form with fields of different types, as how many fields I want, I can use drop downs and I can do all of this by using OOP?
...