php

image manipulation widget for PHP

Hi - Any recommendations for how to resize & crop images in a PHP web app? Ideally will integrate into the UI to allow user to upload, preview, then optionally resize and crop. Thanks, Graham ...

php mssql_connect: failed

I am moving data from a MSSQL database to a MySQL database. I need to connect with PHP to MSSQL and then insert into MySQL. Could someone tell me how to: See if the mssql server is running remotely, How to connect to it? Code: mssql_connect($host,$user,$pass) or die('Failed Server Connect! ' . mssql_get_last_message()); mssql_selec...

How to Create a CSV file using PHP (and upload it).

For example, I have a variable "$foo" that includes all the data which I want to show in the CSV: $foo = "some value,another value,last value"; My goal is to: Create a CSV file named "some.csv" whose contents are equal to $foo Upload "some.csv" to my server. How can this be done? Update: Here's the exact code that worked for me. ...

Beginning PHP development

I am starting on a project where I will be making HTML and CSS edits to PHP site. I need to configure my home computer to run the site and do PHP development work on it. What is the best recommendation for a beginner to start PHP development? I have an extensive background using the Microsoft programming stack and .NET development. M...

How to create a Login and Registration page in Objective-C and how connect it to the server?

Hi guys! I want to create a Login and Registration page in Objective-C but I am very new in iPhone programming. How can i create that pages and how connect it to the server? Thanks to everyone can help me! ...

DOM/XPATH in PHP: What is nodeValue?

Can someone explain to me what is nodeValue in this and write out how nodeValue look like or write out what's in nodeValue? EDIT: Sorry! Yes, this is PHP. And.. foreach ($elements as $e) { echo $e->nodeValue; } What does the arrow thingy mean (->)? That's an array right? Well if you can explain to me this one part that would be gre...

Disable errors in PHP

How to disable errors just for particular php function, and in the same time to know that the error occurred? For instance, I use a php function parse_url, to parse an array of urls, sometimes it returns an error, what I want to do is to parse next url once error occurs, and not to show it(error) on the screen. ...

PHP Doctrine ORM newbie - Valid DSN for dropping database?

Hi, I'm going through the tutorials for doctrine and liking it so far, however I'm stuck at the point of dropping/regenerating the db schema. This is the code I am using (pretty much straight from the tutorial) require_once(dirname(__FILE__) . '/lib/vendor/doctrine/Doctrine.php'); spl_autoload_register(array('Doctrine', 'autoload')); $...

For storing results, should I store in MySQL or .txt?

I have been working on a cURL script and I am finally done, yay! Basically, right now, I am grabbing the error / success message and storing it, but how should I store it? Should I store it in a .txt file or MySQL. What is a efficient/common practice? EDIT: I already have a MySQL database. I do not mind taking a little more time. After...

what to do about Procedural code, business logic and queries in PHP

I have been tasked with supporting and maintaining several PHP/MySQL web apps (I use the term 'app' lossely) that seem to defy every known coding standard. The PHP code contains routines, procedures, business logic, and even queries - it's all in the code. There is no object-orientated programming, not even MVC, and certainly no separ...

compare array values

I have a string like this, which I need to extract the address from: $string="xyz company 7 th floor hotel yyyy 88 main Road mumbai 400000 this is sample comapny address 9456 and some other"; $word=str_word_count($string,1,'0...9'); Now word has each word like word[0]=xyz, word[1]=company, word[2]=7, etc. I need to compare each va...

Inserting a custom_field in Wordpress using MySql

I have asked here(http://stackoverflow.com/questions/1670838/inserting-a-post-in-wordpress-using-mysql) about how to insert a post in wordpress using mysql, but now I also need to insert some custom fields values, for example: if I have a custom_field called stack how can I insert a value for that custom field using mysql... ...

PHP - Find next available time slot

I'm looking for help in writing a script to find the next available time slot. Ex: Person A wants an appointment and the available time slots everyday is 9am, 12pm, 4pm, 6pm, 9pm So, I need to check existing data and compare the time slots booked for the other appointments and then find next available. $apts = array( 'Person ...

Working on PHP projects on a remote dev server via sFTP

Hello, I'm looking for an editor that can read and write remote PHP files via sFTP. I'm talking about not having a local copy of my PHP files. But here is the tricky part : I'd like that editor to be aware of all the files in my projet, and provide me with intellisense-like auto-completion, classes structures, etc...Just like Eclipse P...

How to correctly modify this Wordpress Function for widgets?

I understand the below function for Wordpress widgets below, register_sidebar(array( 'name' => 'sidebar', 'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widgetTop"></div>', 'after_widget' => '</div>', 'before_title' => '<h2 class="accordion_toggle">', 'after_title' => '</h2>', ...

match a word that is not contained in parentheses

hello, i am trying to split a string by some keywords that aren't contained in parentheses... so, let's say i have the string "i will meet you where we talked (but not where he said)". i want to split the string into 2 pieces. one containing: "i will meet you", the other containing "we talked (but not where he said)". in other words, i ...

jquery ajax response removes the + character

Update: It looks like the problem is when I'm reading the value from the html to begin with. This is the markup: <input name="someval" type="text" value="Receive (+ open)" /> I'm reading the value of someval like this and passing it to the ajax call: $.ajax({ data: 'someval=' + $("input[name=someval]").val(), ...

Retrieving Data From external Domain

I am creating a analytic project. My goal is to give the owner of x-domain a small amount of javascript includes from my site. That gives me the ability trace their mouse movements. I got the tracing down, All I need to do is send the data back to my server so it can be stored in my DB. my problem is the data is too large to send through...

How do I get mod_rewrite to work in my home directory?

I have my PHP files stored under FreeBSD under this directory: /home/david/public_html/code/php In my browser, I access them through this URL: http://192.168.6.7/~david/code/php And I have an htaccess file to rewrite URLs: RewriteEngine on RewriteRule ^test test.php But when I go to http://192.168.6.7/~david/code/php/test in my ...

osCommerce images not displaying

Hi, i really hope someone can help me. I am hosting osCommerce on a windows server 2003, PHP Version 4.3.10. i recently move hosting provider and uploaded my site via FTP and setup database etc, everything appears to be working correctly however for some unknown reason no images are showing on the website. When i view the source of the...