php

How to embed a google map with a changeable area?

I haven't worded this very well But basically, I'd like to embed a map on my site - but the area it shows will change. I've tried doing this, but it never seems to work as it will focus on the wrong area - the old area, rather than the new area. Basically, I'd like a google map code that uses $place as a location. Thanks. ...

var_dump help needed.

The coding below seperates the $state data, I need help putting the var_dump info into $dat1 $dat2 and $dat3 where needed if($en['country'] == 'US'){ if ($_POST['locus'] == ''){$err .= 'Please select and fillin your locale.<br>';} $state = $_POST['locus']; // separate: NEW YORK, NY 10011 preg_match("/(.*)\,\s+([A-Z]{2})\s+([\d]...

PHP/JS/JQUERY: Smart method to Auto check/updating a points status

Hello. Hi everyone. So right now I am using me of this: function checkpoints() { var postThis = 'checker.php?userid='+ $('#user_id_points').val(); $.post(postThis, function(data){ $(".vispoints").html(data).find(".vispoints1").fadeIn("slow") }); setTimeout(checkpoints, 5000); } This function repeats each 5 seconds (...

Apache Email trace

I'm using few PHP scripts for sending Email to website members. Is it possible to see at cPanel WHM mail statistic which PHP script was sent specific email using sendmail function? At section "View Relayers" I can see Time Sent, Message ID, Sender, Destination but not the script that fired this sendmail function. ...

Optimize existing code and need to list alphabetically.

I need help optimizing the code to run faster, unless it is optimized the best. I also want to alphabetize the list and I am unsure how to do that. It should be alphabetized by $userinfo[0]["sn"][0] I am using the adLDAP class: http://adldap.sourceforge.net/ <?php require_once('adLDAP.php'); //header('Content-type: text/json'); $adl...

Remove All After Delimiter PHP

Hi, I'm just wondering how I could remove everything after a certain substring in PHP ex: Posted On April 6th By Some Dude I'd like to have it so that it removes all the text including, and after, the sub string "By" Thanks ...

multi word query in mysql

Hi there , in order to make things easier for users i want to add multiple keyword search to my site. so that in the input the user would do something like : " keyword1 keyword 2" ( similar to google for example. would i need to write a code that would parse that string and do queries based on that or is there something built in mysql th...

Update a Google Doc (or file stored with Docs) with PHP

It seems Zend Gdata doesn't provide a way to interface with the PUT API for Google Docs. I'd like to clear a document with a known id and update its contents. Should I authenticate with Zend's Gdata and use an HTTP PUT request? How? ...

PHP mssql_query double quotes cannot be used

Hi all, In java-jdbc, I can easily run the following SQL (NOTE the double quotes around columns and table names) Select cus."customer_id" , cus."organisation_or_person" , cus."organisation_name" , cus."first_name" , cus."last_name" , cus."date_became_customer" , cus."other_customer_det...

htaccess query_string and rewrite rule

hello guys I'm using this htaccess script to set search.php?q=sometng&type=all to search/sometng/ RewriteCond %{QUERY_STRING} q=(.*)&type=all RewriteRule ^search\.php$ /search\/%1\/? [R=301,L] it works succesfully BUT I GET 404 error! I've tried to put RewriteRule ^search/(.*)/$ search.php?q=$1&type=all it returns Attempting t...

Dynamically including multiple files within php for image descriptions

Working on implementing image descriptions to a php run gallery and can't seem to figure out how to call each text file for each individual image. I would need to place a div in the code for the image and then call the include. //total number of images $total = 77; //max number of thumbnails per page $max = 9; //what im...

Numerical Date To Text Date PHP

Hey, I'm just wondering how to convert a numerical date into text format in PHP Example change 06.04.2010 to say April 6th 2010 Is there any function already made? ...

session_start and Dreamweaver templates

session_start() should be the first line of web page. Dreamweaver's php templates should be used inside the HTML tag (so, obviously this is not the first line). What to do? ...

Why wont this simple code work all of a sudden?

Why won't this print "success" when I submit the form? I'm pretty sure it should. <?php if (count($_POST) > 0) { echo "success!!"; } ?> <form method="post" enctype="multipart/form-data"> <input type="file" name="userfile" /> <input type="submit" value="upload" /> </form> ...

How to rebuild Safari Web Clip functionality in PHP

Hi there, is there a way to rebuild Mac OSX Snow Leopard's Dashboard Widget 'Web Clip' on a PHP website? Something like a crawler or scraper. I thought about using file_get_contents to getting the page content into the page, but how do I select a section on the external page? And does this work with session/login content as well? I'm ...

PHP - Checking whether a string exists in an entire array?

Hi all, Basic array question: $string = "The quick brown cat"; $check1 = "apple"; $check2 = "ball"; $check3 = "cat"; if ( (stripos($string, $check1) === false) || (stripos($string, $check2) === false) || (stripos($string, $check3) === false) ) { echo "Fail"; } How do I condense the above using an array ($check[])? ...

how to handle DOM in PHP

my PHP code $dom = new DOMDocument(); @$dom->loadHTML($file); $xpath = new DOMXPath($dom); $tags = $xpath->query('//div[@class="text"]'); foreach ($tags as $tag) { echo $tag->textContent; } what i'm trying to do here is to get the content of the div that has class 'text' but the problem when i loop and echo the results i only ge...

how to get Apache to reload php.ini in WIndows XP?

I'm trying to install XDebug by registering it in php.ini but it isn't working. I'm thinking maybe my apache server is not reloading my changes properly. -from your friendly PHP noob ...

How do I modify an attribute across all rows in a table?

Hi folks, My apologies for asking such a novice question but, I need help building a script using either PHP or directly in MySQL that can do the following: Take the values of a column in a table (text) Change them into capitalized words (from "this is a title" to "This Is A Title") Replace the old values (uncapitalized) with the new ...

Order Multidimensional Arrays PHP

Hi everyone I have some problem to order an array by a field of this, here i leave the example foreach($xml as $site){ echo '<div><a href="'.$site->loc.'">'.$site->loc.'</a>' .$site->padre.'</div>'; } Some times the filed $site->padre is empty but i'd like to order by $site->padre alphabetical i saw example with usort but i don't und...