php

Why are some characters shown as question marks when sending email using non-English characters?

I tried to send a text email with non-English characters using PHPs mail function. But instead my message went with funny looking garbage characters. How do I fix it? I use this piece of code: function _mail($to, $subject, $content) { $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Ma...

Zend_Router, routing to indexController / forward when parameter provided

Hi, is there any way to tell the Zend Framework Router: " if www.domain.com/test " is called forward to indexController - forwardAction and recieve the parameter. " if www.domain.com" is called show indexController / indexAction ?? ...

Separate text and html part from incoming email

Is there a way to separate text and html part when any incoming email is received ? I am using PHP. If the content-type of the incoming email is multipart/alternative Mail received from Outlook are throwing garbled text when the message they contains get forwarded. ...

Most efficient way to insert two rows that depend on each other.

I have a site that is essentially a collection of links. A mysql database which stores users, links and votes. My links table has two foreign keys, user_id and vote_id. When a link is inserted into the database it will start with one vote so that means I need to insert a row into the votes table but they essentially depend on one anot...

php renaming session ID

By default the initial PHP session ID is:PHPSESSID However, when I change that to:YourVisit and I click on Cookies, and view Cookie information after submitting my form there are two Cookies: PHPSESSID and YourVisit, I thought there was only suppose to be one session ID? This has been occurring even after hitting Clear Session Cookies b...

PHP: fill an array with numbers

If i have a variable $num = 50 how can i put numbers 1-50 into an array? (50 is an example.. i wont know how many questions) ...

header php not working

well am trying to use the header to send information, but my html is already outputting information, I tried to fix the problem by using the ob_start() function to no avail ob_start(); require('RegisterPage.php'); if(isset($_POST['register'])) { if(register($errormsg,$regnumber)) { $to = $_POST['ema...

paging next and previous links don't work!

hello can anyone help me with this code?the next and previous links don't work $limit=20; mysql_connect("localhost","root",""); mysql_select_db("autoschool") or die("Unable to select database"); $query = "select * from student"; $numresults=mysql_query($query); $numrows=mysql_num_rows($numresults); if ($numrows == 0) { echo "empty"; } ...

To populate select options at backend using Symfony?

the symfony form is, 'nation' =>new sfWidgetFormChoice(array('choices' => NationPeer::getAllNation())), 'township' =>new sfWidgetFormChoice(array('choices' => TownshipPeer::getAllTownship())), On selecting the nation (like India) it should populate township(with the township within India). I Dont want to use Javascripts! ...

What is the purpose of these PHPDOC properties?

In general, the PHPDOC properties are self-explanatory, but I'm having hard time understanding these: @category - what is this exactly? @package - could some one provide me examples about the usage of this property? ...

edit xml file (site-map) with php !

I need to make a script which auto-increments an xml sitemap (for use by search engines) every time a new ad is created on my site (classifieds site using php and mysql). I have got stuck at how to auto-increment the xml site map. Every site map can contain a maximum of 50000 records of URLS. Besides, whenever a user deletes their ad (...

iPhone dev question: NSMutableURLRequest, cannt set the _GET to my from in php

Hi guys, I have a php form, that is working. With that form I connect to a DB, where i get data out. :-) When I use the form from my Mac/laptop, i can enter the sata and I get the result. When i try to connect with this code under here. I can pass the form, and establich connection to DB, but my query, where I put country in, is empty...

(YUI uploader) listeners not fiering events

I'm trying to use YUI uploader, but I'm not able to open the file dialog window when I click the browse button. I'm following (more or less) the example on Yahoos demo. Here is my HTML code: <div id="fileProgress"> <input id="fileName" type="text" size="40" /> <input id="uploaderUI" name="uploaderUI" class="submitButton" type="butt...

Zend Framework User Registration- adding to db

Hey, so I'm coding a php application, and I've run into an error, which I am for some reason not seeing (me being really bad at coding and lack of sleep may have something to do with it. Anyway, here's my tricky problem :) Parse error: syntax error, unexpected $end, expecting T_FUNCTION and the code: The model class Model_DbTable_Us...

Can I choose some(not all) elements in an array and shuffle it in PHP?

Can I choose some elements in an array and shuffle it in PHP? You know, when you use shuffle(array) , It shuffles all elements in an array, but I just want to shuffle some elements in an array while keep other elements unchanged, how to do it? ...

two conditions in if statement with php

Hi is that possible to do that? <?php if($limit != "0" && $num_down < $limit || $limit == "0") { //stuff } ?> i need to check if limit equals to 0 or if it is not, if $num_down is under limit. Thank you ...

Display threaded comments with MySQL & PHP

Hello guys, Given the following table, how can write a MySQL query to display threaded comments in a single page? Table structure: comment_id comment_parent comment_content Thank you. ...

Php paypalewp on windows not working right, short return

I am working on a payment script using paypalewp, it seems to work fine in the stage environment which is a centos linux box, however on my dev box it doesn't... when I run the button creation script on my local machine (windows vista ultimate) the button generated code looks like this -----BEGIN PKCS7----- MIIBhwYJKoZIhvcNAQcDoIIBeDC...

Why is there an & before $input in array_splice ( array &$input , int $offset [, int $length = 0 [, mixed $replacement ]] )

array array_splice ( array &$input , int $offset [, int $length = 0 [, mixed $replacement ]] ) Why is there an & before $input? ...

Apache Mod Rewrite: RewriteRule with L argument. What's wrong?

Hi, I'm developing a php application and I have a little issue with Apache and Mod Rewrite. Anyone knows what's wrong here?: RewriteEngine on RewriteBase /mysite/ RewriteRule ^css\/css\.css css/css.php [L] RewriteRule ^js\/js\.js js/js.php [L] RewriteRule !^img\/.* index.php When I put http://localhost/css/css.css appears index.php, m...