I have a PHP photo gallery that reads the GPS coordinates from images. I'd like to modify it to use the coordinates and include a google map on the photo page. Is there a simple way to display a google map on an HTML page by supplying just this pair of information?
Thanks.
visitors from either of 3 countries New Zealand, Fiji or India, need a different content page respectively. site is php, content is in html files ready to be included.... im a newb please be patient!!
hi
im using ffmpeg in my server and every thing is working fine except one that the image(thumbnail) creation im using this script
/usr/bin/ffmpeg -i /var/www/test/test.flv -deinterlace -an -ss 13.45
-t 00:00:05 -r 0.01 -y -s 120x72 -vcodec mjpeg
-f mjpeg /var/www/test/test.jpg
is there any problem with the PHP or ffmpeg
Thanks
hey guys
is it possible to have two forms with two submit buttons but when i click on the button then it saves both forms input fields
im concerning to solve this in php /mysql
i tried my own way :
if ((isset($_POST["form-1"])) && (isset($_POST["form-2"])) {
//SQL Insertion
}
thanks in advance
nHibernate has a great feature called filters, so i can create criterias globally for my applications. I'm starting a project in PHP and i need to use an ORM, i'd like to know if Doctrine has a similar feature to manage query conditions.
thanks
I have a timezone name and I want the name of the timezone double its offset.
For instance, Asia/Dubai is +4, I want to double that to +8... and have it resolved to Asia/HonkKong
Language: PHP
Here's a sample of what it would look like:
$timezone = "Asia/Dubai"
$offset = $timezone->getOffset();
$offset *= 2;
$timezone = $offset->getTimeZone();
Output: Asia/HonkKong
I know that header_remove doesn't work in php versions < 5.3 and I use 5.2.1. I am looking for an alternative to header_remove to remove the X-Powered-By header.
I tried using header("X-Powered-By: "); but it still generates a blank header. I tried using Header unset X-Powered-By in .htaccess, but for some reason it's not working. I am stuck here.
The company I work for currently uses some basic functions to abstract the OCI libraries as a means for DB connectivity. We're considering switching to PHP's PDO object, but from some quick searches, it looks like the Oracle driver is a bit less mature than the other PDO drivers. I would appreciate some pro/cons for PDO/Oracle from anyone who has used it in a production environment.
Thanks!
Hi all,
I'm trying to rewrite some query strings I have in my URL like this :
foo.com/index.php?page=admin&view=news&action=edit&id=3
to
foo.com/admin/news/edit/3
But can't figure it out...
it should also works if I only have the 'page' parameters for example, since I don't always have these 4 parameters (page,view,action,id) in my urls, of course.
any suggestions?
Hai
Thanks for everything. I have successfully implemented clean URL in local. Very nice site.
Now my objective is to create a clean URL web site in PHP Microsoft IIS 5.0, I know this in Apache. But I don't know how this on IIS. Does any one give me a solution?
Hi.
Tumblr and other blogging websites allows people to post embeded codes of videos from youtube and all video networks.
but how they filter only the flash object code and remove any other html or scripts? and even they have an automated code that informes you this is not a valid video code.
Is this done with REGEX expressions? And Is there a PHP code to do that?
Thanks
Hi, I am getting the error; Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Why do I get this error? The mysql_real_escape_string() works on all of my pages apart from one? Is it something to do with MySQL being on a different server to the PHP server - if so, how do I fix it?
Thanks Tom
Is there a good method of form security that does not involve CAPTCHA? CAPTCHA is so annoying, but I need security because I am getting form spam. My form is PHP.
I try to send http request like:
..."POST http://api.facebook.com/restserver.php?method=facebook.users.setStatus&api_key=762ec91e7987aaeaee7e2cdfdfcb3c30&call_id=$call_id&sig=$s&v=1.0&uid=1533439618&status=44 HTTP/1.1";....
but I receive nothing...
in twitter I success:
..
"POST ht tp://twitter.com/statuses/update.xml?status=123123 HTTP/1.1"
...
Ok, I'm about 50% done with the "30 minute" quickstart guide from Zend.
I must be missing something, because this seems like a total waste of time. The point of this quickguide is to create a guestbook, something I could do in 5 minutes with regular naked non-framework php.
Here's my path to zend framework:
c:/program files/wamp/www/_zend/
Here's my path to my quickstart project:
c:/program files/wamp/www/_zend/bin/quickstart/
I have a number of questions at this point:
http://framework.zend.com/docs/quickstart/create-a-model-and-database-table
1: I'm running the command line to run my database loading script. I get an error stating the it can't find the Zend/AutoLoader.php becuase my path to the zend library is wrong. I followed all of the steps. I defined the path to my zend library in the main config file, but for some reason, its defined again in my db loader. In all of these scripts that they have me load, it points the relative path to the zend library as being /../library
Problem is, there's nothing in that folder. To get to my actual zend folder, you'd need to be (relatively) /../../../../library
Which brings me to my 2nd question:
2: Where the #$#$ is the main Zend files supposed to be? The install directions were basically "put it wherever you want", when the real answer (after a bunch of errors and wasted time was) was "put it somewhere so that its really easy to type the full path a thousand times in command line" and "it also better be in a runnable place on your webserver since its going to create your quickstart application in a subdirectory within zend".
Which brings us to the third question
3: Am I supposed to have this libary in both the parent core Zend (wamp/_zend/library) AND my application (quickstart/library)?
4: If that is the case, it seems like a ton of wasted files to be uploading. I'd like to use Zend to create products that my customers will download. 5 megs of overhead seems like a bit much. Zend claims you can use these library components separately, but it looks to me like I'm going to have to upload them every time.
Which leads to the next question:
5: It appears that perhaps Zend is more for a single application that is not supposed to be distributed. Is this not the case?
6: According to their default file structure everything but my /public folder would be above public_html on my server if I wanted this to rest on my TLD. I would need to rename every reference of /public/ to /public_html/, or am I missing something else?
I am currently running a simple EJB application using a stateless Session Bean. I am working on NetBeans 6.8 with Personal Glassfish 3.0 and I have installed on my system both the Java EE and the Java SE. I don't know whether it is relevent but I am running Windows7 64-bit version. The Session Bean I implemented has just one method sayHello(); which just prints hello on the screen. When I try to run the application I'm getting the following error:
pre-init:
init-private:
init-userdir:
init-user:
init-project:
do-init:
post-init:
init-check:
init:
deps-jar:
deps-j2ee-archive:
MyEnterprise-app-client.init:
MyEnterprise-ejb.init:
MyEnterprise-ejb.deps-jar:
MyEnterprise-ejb.compile:
MyEnterprise-ejb.library-inclusion-in-manifest:
MyEnterprise-ejb.dist-ear:
MyEnterprise-app-client.deps-jar:
MyEnterprise-app-client.compile:
MyEnterprise-app-client.library-inclusion-in-manifest:
MyEnterprise-app-client.dist-ear:
MyEnterprise-ejb.init:
MyEnterprise-ejb.deps-jar:
MyEnterprise-ejb.compile:
MyEnterprise-ejb.library-inclusion-in-manifest:
MyEnterprise-ejb.dist-ear:
pre-pre-compile:
pre-compile:
do-compile:
post-compile:
compile:
pre-dist:
post-dist:
dist-directory-deploy:
pre-run-deploy:
Starting Personal GlassFish v3 Domain
Personal GlassFish v3 Domain is running.
Undeploying ...
Initializing...
Initial deploying MyEnterprise to C:\Users\Naqsam\Documents\NetBeansProjects\MyEnterprise\dist\gfdeploy\MyEnterprise
Completed initial distribution of MyEnterprise
post-run-deploy:
run-deploy:
run-display-browser:
run-ac:
pre-init:
init-private:
init-userdir:
init-user:
init-project:
do-init:
post-init:
init-check:
init:
deps-jar:
deps-j2ee-archive:
MyEnterprise-app-client.init:
MyEnterprise-ejb.init:
MyEnterprise-ejb.deps-jar:
MyEnterprise-ejb.compile:
MyEnterprise-ejb.library-inclusion-in-manifest:
MyEnterprise-ejb.dist-ear:
MyEnterprise-app-client.deps-jar:
MyEnterprise-app-client.compile:
MyEnterprise-app-client.library-inclusion-in-manifest:
MyEnterprise-app-client.dist-ear:
MyEnterprise-ejb.init:
MyEnterprise-ejb.deps-jar:
MyEnterprise-ejb.compile:
MyEnterprise-ejb.library-inclusion-in-manifest:
MyEnterprise-ejb.dist-ear:
pre-pre-compile:
pre-compile:
do-compile:
post-compile:
compile:
pre-dist:
post-dist:
dist-directory-deploy:
pre-run-deploy:
Undeploying ...
Initial deploying MyEnterprise to C:\Users\Naqsam\Documents\NetBeansProjects\MyEnterprise\dist\gfdeploy\MyEnterprise
Completed initial distribution of MyEnterprise
post-run-deploy:
run-deploy:
Warning: Could not find file C:\Users\Naqsam\.netbeans\6.8\GlassFish_v3\generated\xml\MyEnterprise\MyEnterpriseClient.jar to copy.
Copying 1 file to C:\Users\Naqsam\Documents\NetBeansProjects\MyEnterprise\dist
Copying 4 files to C:\Users\Naqsam\Documents\NetBeansProjects\MyEnterprise\dist\MyEnterpriseClient
Copying 1 file to C:\Users\Naqsam\Documents\NetBeansProjects\MyEnterprise\dist\MyEnterpriseClient
java.lang.NullPointerException
at org.glassfish.appclient.client.acc.ACCLogger$1.run(ACCLogger.java:149)
at java.security.AccessController.doPrivileged(Native Method)
at org.glassfish.appclient.client.acc.ACCLogger.reviseLogger(ACCLogger.java:146)
at org.glassfish.appclient.client.acc.ACCLogger.init(ACCLogger.java:93)
at org.glassfish.appclient.client.acc.ACCLogger.<init>(ACCLogger.java:80)
at org.glassfish.appclient.client.AppClientFacade.createBuilder(AppClientFacade.java:360)
at org.glassfish.appclient.client.AppClientFacade.prepareACC(AppClientFacade.java:247)
at org.glassfish.appclient.client.acc.agent.AppClientContainerAgent.premain(AppClientContainerAgent.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:323)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:338)
Java Result: 1
run-MyEnterprise-app-client:
run:
BUILD SUCCESSFUL (total time: 1 minute 59 seconds)
see next post.
Im using the Twitter API to read the Favorites RSS, it generates the following output:
http://vl3.co.uk/favs/getfavs.php
I'm not sure why this file seems to be incorrect, doesnt come up in my RSS reader or render correctly in the browser. Can anyone shed any light on this?
If the output is not valid RSS how can I make it so?
Secondly I'd like to cache the RSS feed to then use something like Magpie RSS Parser.
I am trying to run a script on my local machine, I am on MAC OSX leopard. I have PHP 5.2.x installed and Apache2. I am trying to test this script but I keep getting this error. I googled around a little and saw something where it said it might only be available on linux/unix machines but I find that hard to believe.
Hello,
I am trying to create my own torrent tracker but dont know how to generate info_hash that is used xbtt to track torrents.
Is this possible with php?
I am using this function to bencode and decode http://paste.lisp.org/display/17178
Thank You.
Hello,
I'm kind of a website development nub so bear with me.
My problem is that the website php session doesn't seem to be set when I log in to my website. After ensuring that the username and password are correct, I have the following simple code:
$_SESSION['username'] = $myusername;
$_SESSION['password'] = $mypassword;
session_start();
Content that should display after logging in is not displayed.
Thanks in advance,
Matt
I have a script that is designed to parse XML postbacks from Ultracart, right now just dumps it into a MySQL table. The script works fine if I point it to a XML file on my localhost but using 'php://input' it doesn't seem to grabbing anything. My logs show apache returning 200 after the post so I have no idea what could be wrong or how to drill down the issue.. here's the code:
$doc = new DOMDocument();
$doc->loadXML($page);
$handle = fopen("test2/".time().".xml", "w+");
fwrite($handle,trim($page)); // it doesn't save this either :'(
fclose();
require_once('includes/database.php');
$db = new Database('localhost', 'user', 'password', 'db_name');
$data = array();
$exports = $doc->getElementsByTagName("export");
foreach ($exports as $export) {
$orders = $export->getElementsByTagName("order");
foreach($orders as $order) {
$data['order_id'] = $order->getElementsByTagName("order_id")->item(0)->nodeValue;
$data['payment_status'] = $order->getElementsByTagName("payment_status")->item(0)->nodeValue;
$date_array = explode(" ",$order->getElementsByTagName("payment_date_time")->item(0)->nodeValue);
if ($date_array[1] == 'JAN') { $date_array[1] = '01'; }
if ($date_array[1] == 'FEB') { $date_array[1] = '02'; }
if ($date_array[1] == 'MAR') { $date_array[1] = '03'; }
if ($date_array[1] == 'APR') { $date_array[1] = '04'; }
if ($date_array[1] == 'MAY') { $date_array[1] = '05'; } // converts Ultracart date to
if ($date_array[1] == 'JUN') { $date_array[1] = '06'; } // MySQL date
if ($date_array[1] == 'JUL') { $date_array[1] = '07'; }
if ($date_array[1] == 'AUG') { $date_array[1] = '08'; }
if ($date_array[1] == 'SEP') { $date_array[1] = '09'; }
if ($date_array[1] == 'OCT') { $date_array[1] = '10'; }
if ($date_array[1] == 'NOV') { $date_array[1] = '11'; }
if ($date_array[1] == 'DEC') { $date_array[1] = '12'; }
$data['payment_date'] = $date_array[2]."-".$date_array[1]."-".$date_array[0];
$data['payment_time'] = $date_array[3];
//... we'll skip this, there are 80 some elements
$data['discount'] = $order->getElementsByTagName("discount")->item(0)->nodeValue;
$data['distribution_center_code'] = $order->getElementsByTagName("distribution_center_code")->item(0)->nodeValue;
}
}
}
$db->insert('order_history',$data);
} else die('ERROR: Token Check Failed!');
Is it possible to read cookie expiration time with php ?
When I print_r($_COOKIE) it outputs:
Array
(
[PHPSESSID] => 0afef6bac83a7db8abd9f87b76838d7f
[userId] => 1232
[userEmail] => [email protected]
[firstName] => user
[lastName] => user
)
So I think $_COOKIE don't have the expiration time, is it possible with some other function?
Is Magento usually so terrible slow?
This is my first experience with it and the admin panel simply takes ages to load and save changes. It is a default installation with the test data.
The server it is hosted on serves other non-Magento sites super fast. What is it about the PHP code that Magento uses that makes it so slow, and what can be done to fix it?