When should I NOT use mysql_real_escape_string
I saw this comment.... http://www.php.net/manual/en/function.mysql-real-escape-string.php#93005 And began to wonder why this would be a bad idea. ...
I saw this comment.... http://www.php.net/manual/en/function.mysql-real-escape-string.php#93005 And began to wonder why this would be a bad idea. ...
I know you can get a $_SERVER['HTTP_X_REQUESTED_WITH'] php variable if jquery has loaded. That's great but if you use an iframe then that variable is no longer available. Is there a way to detect if jquery has loaded and give php a varaible in an iframe? I don't want to load a header or footer if jquery has loaded 100% but otherwise put ...
I'm creating a PHP web application framework (MVC). I'd rather not use external libraries or components (as I want this to be purely my work for now) Can you tell me some tips/guidance for what each of my files should be responsible for doing? Such as, what should be handled by the Framework script and what should be handled by an Appli...
I'm wondering if there's a best practice for this, I'm building a site that's going to require quite a few models and I don't want to end up with a unstructured mess. Basically I'm looking for a good rulesheet to structure out the models. Right now I can only think of two ways: Every table in the db has its own model, ie. accounts.php,...
I'm trying to integrate with the Articulate Online SOAP API (https://www.articulate-online.com/Services/Api/1.0/Documentation/TOC.aspx) on a PHP4 server using the NuSOAP (http://sourceforge.net/projects/nusoap/) client. I've done NuSOAP integrations in the past without much effort, but this one seems to be more troublesome due to the co...
I have one form as shown below: Page 1: <form name = "form1" method="post" action = "page2.php"> ........ </form> Page2.php: <?php For loop ... ..... end ?> Now i want to have progress bar on page 1 so that it can show the completion progress of for loop in page2.php. Tell me how can i do that? Please don't direct me to any pro...
Hello, I am using a table in MySQL called "submissions" that contains fields called "loginid" and "datesubmitted." "Loginid" is an integer and "datedubmitted" is a timestamp. I would like to make a function that will determine whether or not a given "$uid" equals a "loginid" that has 11 or more rows in "submissions" with a "datesubmit...
I have a news script in PHP i need the script to replace any link which it will be included within the news (links to other websites which the original news will be there ) i need the link for the website to be replace with click here instead , all the links will be replaced every time with click here ...
I want to set text of some node found by xpath() <?php $args = new SimpleXmlElement( <<<XML <a> <b> <c>text</c> <c>stuff</c> </b> <d> <c>code</c> </d> </a> XML ); // I want to set text of some node found by xpath // Let's take (//c) for example // convoluted and I can't be sure I'm setting right node $firstC = r...
How can I find the Unix Timestamp of midnight on (the beginning of) the most previous Monday? ...
I have a simple table like this: +------------+---------+-----------+--------------+ | comment_id | post_id | parent_id | comment_text | +------------+---------+-----------+--------------+ | 1 | 200 | 0 | a | | 2 | 200 | 0 | b | | 3 | 200 | 1 | ...
Possible Duplicates: How do I extract HTML content using Regex in PHP RegEx match open tags except XHTML self-contained tags Hi, I dont know regex, i working with PHP (possible use Zend framework) I need to get from html page images and links. I think the best way to do it with regex, regex pattern that insert images and ...
I am wondering if there is a script similar to the facebook status update thing, What I mean, is when for ex. I paste a youtube/other video site/image/link it automatically detects the contents of the page and associates an embed code with it (if its a video).. So I'm wondering if there is a ready script that has a large database of web...
As far as I can tell, the only reason we have namespacing in PHP is to fix the problem of classes (+ functions & constants) clashing with others classes of the same name. The problem is that most frameworks setup their autoload and filesystem hierarchy to reflect the names of the classes. And no-one actually require()s or include()s fil...
Here's the scenario. I have a website and I want to start open-sourcing some of the modules that I've developed. I originally looked into the GPL, but I notice there's a loophole where people don't have to share their modifications if they're used on a public website. I then found AGPL which seems better suited to my scenario, but have...
Can someone tell me what the PHP would look like in order to get a category from Wordpress and then print it where ever I want? I'm guessing I have to build a PHP function. Something like: function get_a_category() { $category = get_the_category(); <-----( not sure how to ge ta specific category ) echo $category; } I have no idea ...
I have wrote a function for getting all the subfolders of a folder. It also has the option of going the an upper level and displaying the folders....much like a file manager but it works only for folders and has a restriction to not go upper than the base folder so to prevent users from browsing the entire hard disk. I am returning the ...
I am using PHP to interact with a Web Service using REST and HTTP GET requests to call on the available APIs to return XML data. When testing via the address bar, I get the expected XML content. So the next step I tried was to read that XML data or store the values returned into a string. But when I use file_get_contents I don't get a...
Here's the response I keep getting when trying to create a new activity: {"error":{"errors":[{"message":"Unknown authorization header","locationType":"header","location":"Authorization"}],"code": 401,"message":"Unknown authorization header"}} Here's the request I sent (for debugging): POST /buzz/v1/activities/@me/@self?alt=json HTTP/...
Hello, i've been thinking if something like this is possible. // this creates a variable $test in the scope it was called from function create_var() {} class A { function test() { create_var(); // now we have a local to var() method variable $test echo $test; } } So, the question is, can a function create_var() crea...