I am using PHP script for some backend tasks(not web) and I found sometime curl_exec will terminate the executing of script without outputing any errors. I want my script to run in a loop forever and any idea about this?
...
I'm new to PHP =) Right now I am using PHP includes for my site template. I have my header, containing all my <head></head> info. What I want to do is write a code that will take the contents of the <h1></h1> tag from the page, and echo it into the <title></title> tag in my header.php include.
I got the PHP Simple HTML DOM Parser from h...
I'm trying to parse a 6,000 line 500 KB file into an array so I can import the data into our system. The problem is that the script stops executing somewhere between lines 3000-4000. There are no breaks in the code, we use it on other imports. Any ideas on why this might be happening and what I can do to prevent it?
/**
* Takes a se...
After weeks of failure, I am completely lost as to how I can covert my site to be ajax based. The main purpose is that I have a bar at the bottom that plays music and I would like it to play as the pages change. Please help me figure this out!
The Ajax area includes:
Google AdSense and Adbrite ads (although I can go without these in A...
I am try to add a javascript using php as follows
<?php
Header("content-type: application/x-javascript");
$serverIP=$_SERVER['REMOTE_ADDR'];
echo "document.write(\"Your IP address is: <b>" . $serverIP . "</b>\")";
?>
Here i need to print my output as follows
Your IP address is: 127.0.0.1
but it is showing result like
document.w...
Hi I have a MySQL database table "points" the user can click a button and a point should be removed from their account, the button they pressed has an ID of another user, therefore their account must increase by one.
I have it working in jQuery and checked the varibles/posts in Firebug, and it does send the correct data, such as:
useri...
I've seen a lot this kind of code recently :
if ($foo = $bar->getFoo())
{
baz($foo);
}
Is this considered good or bad practice ?
For example, Netbeans IDE give a notice if you use this kind of code :
Possible accidental assignment,
assignments in conditions should be
avoided
What do you think ?
...
Does anyone have a great system, or any ideas, for doing as the title says?
I want to switch production version of web app-- written in PHP and served by Apache-- from release 1234 to release 1235, but before that happens, have all files already in the opcode cache (APC). Then after the switch, remove the old cache entries for files fro...
I've been looking at Wordpress plugins for photo galleries (so maybe this is for superuser.com), and I've been very frustrated so far. It seems like what I'd like to do would be a very common use case:
Admin: Be able to upload multiple pictures (at a time)
Admin: Be able to assign a "gallery" to those pictures as I upload them
User: B...
I was just starting to learn cakephp today by going through a "blog tutorial". I created my blog_controller.php and then created a folder named 'blog' with the apps/views/ structure. The next step in the tutorial was to create the index.ctp file within the blog folder under views. In the tutorial it declares that all error messages shoul...
I'm designing a News Feed system using PHP/MySQL similar to facebook's.
I have asked a similar question before but now I've changed the design and I'm looking for feedback.
Example News:
User_A commented on User_B's new album.
"Hey man nice pictures!"
User_B added a new Photo to [his/her] profile.
[show photo thu...
I have a CSV file I'm importing but am running into an issue. The data is in the format:
TEST 690, "This is a test 1, 2 and 3" ,$14.95 ,4
I need to be able to explode by the , that are not within the quotes...
...
I have an array like this (output from print_r):
Array
(
[price] => 700.00
[room_prices] => Array
(
[0] =>
[1] =>
[2] =>
[3] =>
[4] =>
)
[bills] => Array
(
[0] => Gas
)
)
I'm running a custom function to convert it...
I am attempting to create a search function for user profiles on my site.
$search= $_POST['search'];
$res=mysql_query("SELECT * FROM ".TBL_USERS." WHERE username LIKE '$search%'");
This is the code I use. This will only work if you search something that matches the start of the result. Is there any way I can return values that have wh...
I am collecting registration information on my site and need to figure out how to pass all data stored in the MySQL DB (or just portions of it) as a CSV file through an SFTP so our partners can access the information. The pages are built using PHP.
I literally have no idea how to do this and am hoping somebody has experience doing so.
...
I have a website in which I have a several php forms that I would like to fill out with auto generated content (for the purposes of exercising different content the user could submit). I would like to write a client side application that enables me to do so.
Is there any way either using webtoolkit, java script etc of doing this?
Tha...
I'd like to set some autorun task to Eclipse, or simply set the command with path, how to run my Apache while starting Eclipse.
My point is, that I don't want webserver (Apache) to be running after OS start, because it's useless load for my laptop. I usually want webserver use when I start Eclipse, so I think there could be an option, w...
I have read many forums (including this one) about passing session variables between subdomains, and I can't get this to work. Can someone explain what I am missing?
Step 1
In the php.ini file: session.cookie_domain = ".mydomain.com"
Verified with phpinfo() that I am using the right php.ini file
Step 2
In page at www.mydomain.com set...
Is there any way you can overwrite a line in PHP. let me be a little more clearer using examples.
My array
array{
[DEVICE] => eth0,
[IPADDR] => 192.168.0.2,
[NETMASK] => 255.255.255.0,
[NETWORK] => 192.168.0.0,
[BROADCAST] => 255.255.255.255,
[GATEWAY] => 192.168.0.1,
[ONBOOT] => no
}
File im overwriting
...
I was pretty excited to read about anonymous functions in php, which let you declare a variable that is function easier than you could do with create_function. Now I am wondering if I have a function that is passed a variable, how can I check it to determine if it is a function? There is no is_function() function yet, and when I do a var...