Ok, so my PHP is, to say the least, horrible. I inherited an application and am having to fix errors in it from someone that wrote it over 7 years ago. When I run the page, there is no return, so I checked the logs to see the error and here is what i get:
PHP Parse error: syntax error, unexpected '=', expecting ',' or ';' in /http...
I'm working on an image gallery that looks up all of the images that I have uploaded, and allows me to display them 5 at a time on a single page. The problem is, i'm unsure about how to approach this.
I have $_GET['max'], which is supposed to be the top most image to be displayed. $min would be $_GET['max'] - 5. In the event that the...
I want to send data to an emailaddress and save it into a MySQL database (PHP).
What is the easiest way to do this? (no form post, no curl etc., just email)
...
I'm creating a blog, and am storing user permissions (to post/edit/delete blog posts) in a mysql table.
Should I create one column per permission, or combine all percussions into a string in one column such as 101 would mean that a user could post and delete but not edit.
The reason I ask is that I am worried about having too many colu...
For a little while now I've been searching for a code to get URL's out of a string using PHP. I'm basically trying to get a Shortened URL out of a message, and then later do a HEAD request to find the actual link.
Anyone have any code that returns URLs from strings?
Thanks in advanced.
Edit for Ghost Dog:
Here is a sample of what I...
Should be a simple question, I'm just not familiar with PHP syntax and I am wondering if the following code is safe from SQL injection attacks?:
private function _getAllIngredients($animal = null, $type = null) {
$ingredients = null;
if($animal != null && $type != null) {
$query = 'SELECT id, name, brief_description, des...
So I am porting a VBA application to PHP and ran into this wonderful little nugget of code:
expr1 = expr2 Mod expr3 = 0
I thought it was behaving like a ternary operator but when I broke it down to simple if then statements the outcome was not as expected. So I ask the brilliant stack**overflow** community to help me out and put it in...
I want a videoplayer like youtube's on my site. What should I look for? I'm making a videosharing site in PHP with MySQL.
Should I look into flash? Maybe you know some good video players that are easy to implement on a site.
// Mariusz
...
I need to run a .cmd batch file from within a php script. The PHP will be accessed via an authenticated session within a browser.
When I run the .cmd file from the desktop of the server, it spits out some output to cmd.exe.
I'd like to route this output back to the php page.
Is this doable?
Thanks in advance for your time.
...
Why does this give me parse error? going crazy over here..
I have this file right:
function start_connection() {
global $config['db_host'];
}
Parse error: parse error, expecting ','' or ';'' in functions.php on line 5
...
I have been looking for a solution that would allow me to deploy PHP applications on Macs and Windows. I've been developing online applications but would like them to be offline applications as well but that would require that Apache/PHP/MySQL be installed on their platforms as well. I've set up WAMP and it was NOT that easy. Lots of con...
Hi,
I am facing some problems converting the PHP SQL insertion code below to ASP, I want to use the same concept in ASP, because it is more flexible, not tied to ASP owned keywords.
Wonder if anyone can help ASP newbie here.
$table = 'tbluser';
$array = array (
'name' => $name,
'email' => $email,
'ip' => $remoteIP
...
How do we test a web application for the memory leaks? How much does it contribute to the overall performance of the site? Please suggest any tool which can help us test the web application for memory leaks.
...
Say for example I wanted grab the results from the first 3 pages in Google. So basically I want the top 30 results. I can go about grabbing the first 10 on page 1, but how do I tell Curl that once page one is done, "click" the second page and so on?
...
I have had a number of requests from clients wanting to take a customer's credit card number online and then process the payment in store at a POS of terminal. I'm wondering what the best method of doing this is.
I don't want to store the credit card number on the server in plain text and I don't want to send an email with the number in...
At the moment I have a single array made up of multiple other arrays ie:
-- Category
-- Subcategory
-- Name
-- Count
-- Subcategory
-- Name
-- Count
-- Subcategory
-- Name
-- Count
-- Category
-- Subcategory
-- Name
-- Count
-- Subcategory
-- Nam...
Hi there,
I'm parsing a posted encrypted and posted XML file sent to my site from another server.
Currently the XML(decrypted) sorta looks like so:
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<transactions>
<transaction>
<id>407145</id>
<store_id>4067</store_id>
<custom_fields>
<custom_field>
<custom_field_name>aff...
Hi guys, I'm still working on my google maps application. However clustering on the server end works but at the same time its quite slow and at times if I'm zooming out too much and playing around with the panning my browser stalls.
There is only so much that I can choose to hide using clusters.
EDIT
I'm thinking of using mapplets in...
Hi.
I just implemented a sendmail in PHP called from a html page with a form. It requires filling some textfields, then pressing the submit button causing the mail to be sent. So far so good.
Now I need this form to be cleared on successful mail transmission.
My guess is that Internet Explorer (or other) saves all field values when mo...
Hi
Just like we do with __ToString, is there a way to define a method for casting?
$obj = (MyClass) $another_class_obj;
...