Hey everyone,
I found a PHP function to dump a mySQL database that someone else had written, and then cleaned it up and formatted it a bit. I wanted to know if I could get a critique of it. I have ran it, tested it on a Wordpress blog and the DB completely restores, but wanted to get some other eyes on the code.
Specifically I am looki...
I have an array from a $_GET say
Array
(
[0] => 0
[1] => 1
[2] => 2
[3] => 3
[4] => 4
)
for which i am using this while loop to create a string:
while (list($key, $value) = each($_GET)) {
$get_url .= $key . '=' . rawurlencode(stripslashes($value)) ...
Hello.
I have a multidimensional array with strings as keys. I want to perform a function (to manipulate the strings) on those keys and then write to a new array (i.e. leave the original array unchanged).
Example:
$oldArr = array(
"foo_old" => array("moo_old" => 1234, "woo_old" => 5678);
"bar_old" => array("car_old" => 4321...
I have a simple mysql query which is as following:
SELECT DISTINCT(node.nid) AS nid,
node_counter.totalcount AS node_counter_totalcount,
node.title AS node_title,
node_data_field_dep.field_dep_value AS node_data_field_dep_field_dep_value,
node.type AS node_type,
node.vid AS node_vid,
node_data_field_type.field_type_value AS node_data_fi...
Do you know a good online tutorial detailing solving graph problems using PHP, I'm also very interested in optimal graph data type representation in PHP (I assume that would be multidimensional arrays)?
I'm talking about mathematical graph theory (yes, vertices and edges). Google spits out loads of stuff, just not the PHP implementation...
Hello,
I have a table having hierarchical menus like
"id" "parent_id" "name"
1 0 menu
2 1 item1
3 2 item1_1
4 1 item2
5 4 item2_1
...
...
and I have 100s of menu items here. In order to get all items in an array I have to write a recursive function like this
getmenu function(parent_id = 1)
{
$items = mysql_query("SELECT id FROM tab...
I've created a short demonstration of the problem I'm having. This isn't exactly how I'm implementing it but seems to lead to the same result.
<?php
class mainclass {
var $vardata = array();
function &__get ($var) {
if ($this->vardata[$var]) return $this->vardata[$var];
if ($var == 'foo') return $this->_loadFo...
Hello, I'm a newbe here and about PHP; be patient please :-)
I have a MySQL table with 15000 rows; I need to populate a field of it (varchar(15)) - to be used in a way similar to a primary key – with the uniqid() PHP function.
The algorithm is:
positioning to the first row (record);
generating a value with the uniqid() function;
upda...
I'm trying to use an RTF file as a template for generating a new RTF document containing a page per (mysql) database row.
My method almost works except that the generated file contains only one page, with the first row, and not one page for each row. (there should be 2 pages in my test).
Here is the main loop.
$today= date('d-m-Y');
$...
Hi all,
I have a class with the methods __toString and __get and some protected properties such as "message". So far, so good.
The problem now is that I need to access $this->message in __toString, and this causes (NOT ALWAYS BUT OFTEN) a segmentation fault when (see following example) $display_all is set to true. Do you know why and ...
Hello,
I am using WHMCS cart system which has encoded php files.
WHMCS handles all my order processing as follow.
STEP 1 : I look for the product and add to cart.
STEP 2 : Here I configure added product for addons & all.
But here is problem - Sometimes due to slow connection speed Or network/server unavailability browsers show "SERV...
Hey Guys,
I have a php script that comes down to the following:
while ($arr = mysql_fetch_array($result))
{
$url = $arr['url'];
exec("curl $url > /dev/null &");
}
$url will represent a remote script.
My question is, what can I expect if I try to cycle through 2,000 URLs.
Will opening that many CURL connections cripple my s...
So how do i get variable value from php file with jquery...?
the jquery code is in other file (tpl)
for example i have register.php and register.tpl (template file for register.php)
register.php
...some includes here...
if(isset($_POST['submit'])) {
$username = mysql_real_escape_string(trim($_POST['username']));
$email = m...
I'm working on a completely fresh site with php on my localhost. Currently no js or css and i'm not using any php frameworks or libraries. I have never used Feedly in my life!
This problem is stopping images from displaying...
Can anyone think what could be causing data-feedly-processed ="yes" to be added to my body tag?
...
Continuing from my earlier question, how can I combine the month, day, and year <select>s into a single "date" value, so that it arrives at my PHP script as
$_POST['date'], in MySQL format YYYY-MM-DD?
...
I have a form that I need to submit automatically... (the fields are already filled and its complicated to explain why but it IS necessary to do it this way)..
I know how to autosubmit the form using Javascript but the only problem I have is that there is more than 1 submit button.. and I need 1 in particular to be submitted...
thanks in...
Hello, I'm very new to PHP.
I am trying to echo out a chat box/chat room designed specifically for a particular room. Say I have a room called Writer's Block where writer's can gather to 'chat' about their situation. A user will click on an HTML link, something like this:
`<h2 name="WB" id="WB"><a href="www.yyy.com/group.php?id=2/">Wri...
I'm trying to find a phpmyadmin-like db administration tool for SQL Server for a LAMP environment. I've only been able to find similar tools that exist for a IIS/ASP environment.
...
Hello everyone,
I'm just wondering if it's possible to do some automation with php, I.E. going to the href value of id="alinktonextpage", or filling in the values of the form and submitting it.
All this would be not be on my website.
Thanks.
...
I'm new to SOAP, I work with PHP5 and I got my wsdl file with some functions in my .php file. I'm wondering if I can get the url from the customer who uses my Web Service. I want to validate the url in a php function server-side.
...