php

Text on a picture, but like this one. How ?

I've made a pure PHP script that uses GD library to put text on an image, text entered from a HTML form. The problem is that i can't give the user the possibility to position the text properly. I've found this good example http://lolkot.ru/lolmixer/#1369, it allows users to play with the text very easily with the mouse ! How is this po...

Fantasy Draft Tool

I'm attempting to mitigate some of the fantasy football draft issues I've had the last few years by creating my own drafting tool. The major requirement, similar to the major draft tools out there (ESPN, Yahoo, CBS Sports, NFL, etc) is to allow people to log in and participate in the draft. I'd like for the draft to be started by an Admi...

Adding input field to PHP emailer only if it exists, how?

I have a form with inputs for 'name' and 'email'. And another for 'data-1'. The user can click on add button and jQuery will dynamically add a input for 'data-2', 'data-3' etc..as needed. The form is posted to a PHP emailer script which validates fields and places data into a template for mailing. How can i add inputs 'data-2', 'data-3...

How can I troubleshoot why my PHP script won't work in cron when it does from the command line?

I've got a script that calls two functions, A and B, from the same class. A creates an Amazon virtual server and B destroys one, both via shell_exec()'s of Amazon's command line tools. The script, doActions.php, pulls actions from a queue. If the action is "create" it creates an instance; when the action is "destroy" it kills one. The s...

PHP ini_get() and php.ini are not in sync

My php.ini has a memory_limit of 256M. phpinfo() reflects this. But from within PHP, ini_get('memory_limit'); returns 32M. My fatal errors for exceeding memory limit also say that the max is 32M. Any ideas why phpinfo() is lying to me? ...

What is the Best way to kill database Routine(repeated) work in php

What is the Best way to kill database Routine(repeated) work in php , i work daily with php & mysql through pdo and other libs , but i feel i repeat myself over and over ADD , DELETE , UPDATE , especially in admin panel , every task require these operations , its kill the programming enjoyment... ...

How to set a cookie in php?

Hi, I set a cookie and then check if exist like this if(isset($_COOKIE["fan"])) { //Do Nothing } else { $cookie = "yes"; $expire=time()+60*60*24*30; setcookie("fan", $cookie, $expire); include_once("../inc/functions.php"); echo fan_page(); } When I test on my local machine, it works, but when i upload to production server, it do...

How to clean PHP session on page unload?

Hello. I would like to know if calling via AJAX or jQuery or whatever the server side, can I clean a session var?? Nowdays I have a FB application that runs with PHP and it's behaviour depends on a PHP session vars, and I would like to clean that session vars on the HTML event unload in the case that the user returns before the lifetim...

Mobile GPS web application

I need to develop a web app. (PHP) 100% for mobile phones and need to get the information from the mobile phone GPS, in order to get the user's current position. My question is, what should I do? I know PHP but I'm completely clueless about the GPS part (never worked with them before). All i'm looking is for headsup to see if I can hand...

php ftp_ssl_connect pasv timeout returns false

I'm experiencing the same problem as here: http://stackoverflow.com/questions/1609140/ftp-nlist-command-not-working where php ftp_nlist just returns false. In put in the command ftp_nlist ($conn_id, true) But then, the script just runs until it timesout with the following error: Warning: ftp_nlist() [function.ftp-nlist]: php_connect_...

Insert array contents into a string

Hello, I am trying to insert the contents of an array in to a string using PHP. My array ($array1) looks like this: Array1 ( [0] => http://www.example.com/1 [1] => http://www.example.com/2 ) I want to insert both links in to a coma separated string, so I can then insert it in to a database field. I tr...

passing an xml in nusoap

Good day, I am having trouble passing an xml in nusoap. sample: I pass this xml <test>123</test> The nusoap response is test123/test The greater than and less than sign is removed. This is my code for the server: require_once('nusoap/nusoap.php'); $server = new nusoap_server; // Create server instance $server->conf...

Standard PHP error function with __LINE__ __FILE__etc ?

so, instead of lots of instances of if (odbc_exec($sql)) { } else { myErrorHandlingFunction(); } I wrap that in a function function myOdbxExec($sql) { if (odbc_exec($sql)) { } else { myErrorHandlingFunction(); } } BUT I would like myErrorHandlingFunction() to report things like __LINE__ __FILE__ etc Which lo...

Building a simple RESTful api

I'm wanting to make an API quickly, following REST principles - for a simple web application I've built. The first place the API will be used is to interface with an iPhone app. The API only needs handle a few basic calls, but all require authentication, nothing is public data. login/authenticate user get list of records in users group...

Image resizing with PHP advice

Hello, From previous experiences, I've noticed that I'm not very good at integrating 'scripts' created by others, with my own existing code, as of now. I need some advice on understanding what this person is saying about resizing images with PHP: In the comments, he's written: // Parameters need to be passed in through the URL's query...

How to handle large data sets for server-side simulation --> client browser.

Sorry for the somewhat confusing title. Not sure really how to title this. My situation is this- I have an academic simulation tool, that I in the process of developing a web front-end for. While the C++-based simulator is computationally quite efficient (several hundredths to a tenth of a second runtime) for small systems, it can gen...

php mail multiple recepients

Hi, I am able to send email to one email id by defining the id in the mailer, but i am not able to understand how to send to multiple recepients when an user types "mssage and email id's" in a form. Ex - I am showing a form with two text areas - one for email id's and one for custom message. So when they click send, i want to take the e...

php mb_convert_case() keep words that are in uppercase

Hi, Assuming I have a string "HET1200 text string" and I need it to change to "HET1200 Text String". Encoding would be UTF-8. How can I do that? Currently, I use mb_convert_case($string, MB_CASE_TITLE, "UTF-8"); but that changes "HET1200" to "Het1200. I could specify an exception, but it won't be an exhaustive. So I rather all upperca...

PDO's FETCH_INTO $this class does not working

I want to populate class with constructor using FETCH_INTO of PDO: class user { private $db; private $name; function __construct($id) { $this->db = ...; $q = $this->db->prepare("SELECT name FROM users WHERE id = ?"); $q->setFetchMode(PDO::FETCH_INTO, $this); $q->execute(array($id)); ...

Submit mutiple checkbox selections in contact form

Hi, Im new to PHP and Im having trouble getting a contact from to submit multiple checkbox selections. Here is the part of my php that handles the selections: if(trim($_POST['interest']) == '') { $hasError = true; } else { $interest = trim($_POST['interest']); } And this is the part of my HTML: <label for="interest"><strong>I...