php

How to change uploaded file permissions for new files automatically

I recently moved a wordpress site from media temple's gs to their dedicated virtual server. The file structure changed when I upload files. The permissions automatically upload as 644 and I'd like to change this. Where should I look to change this, the php.ini file or somewhere ont he server settings? It uses plesk. ...

PHP E-mail Script not working. What's wrong?

Any help would be much appreciated. Here is the code: <?php include 'header_admin.php'; ?> <?php include 'dbc.php'; page_protect(); checkAdmin(); ?> <?PHP require_once "Mail.php"; $con = mysql_connect("host","username","pass"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("db_name", $con); $elist = mysql...

Continue with PHP or move to Java Framework

I'm building a website for my friend's startup. I'm currently building it on PHP, MySQL, Apache. Everything is going pretty smooth till now, but one of my friend recommends i move to a Java framework because that'd be better when the site becomes bigger. I don't have any Java Knowledge and I have adequate knowledge of PHP but I'm a fast...

How to pass POST data to the PHP-CGI?

Update: In a fit of desperation, I did the following in a shell: REDIRECT_STATUS=true SCRIPT_FILENAME=/var/www/... REQUEST_METHOD=POST GATEWAY_INTERFACE=CGI/1.1 export REDIRECT_STATUS export SCRIPT_FILENAME export REQUEST_METHOD export GATEWAY_INTERFACE echo "test=1" | php-cgi ...and STILL no $_POST variables are showing up in the ou...

Wrong return url in Yii framework

I have used Yii::app()->user->returnUrl but it always redirect me to localhost/index.php. Is there any particular configuration or some pieces of code that other programs that I must write? If you have another solutions let me know it. ...

AMFPHP how to get object in php that is dispatched by flex?

hello i am working on AMFPHP and i had this problem -> i am using XAMPP server with AMFPHP gate way for flex and this is working well for returning values from PHP ->the problem is how can i get the object in php which i passed to the pap class using flex code is here:- connection.objectEncoding = ObjectEncoding.AMF3; ...

How to insert partial data into a Mysql table?

INSERT INTO sitelist(id,rank,websiteaddress,tag1,tag2,tag3,tag4,tag5,tag6,tag7,tag8,tag9,tag10) VALUES ('','','','search','searchengine','discover','find','tag5','tag6','tag7','tag8','tag9','tag10') WHERE `id`=1 The thing is that the first row is like this 1 1 google.com nothing nothing etc I want to insert search searchengine disc...

Time zone handling in php

I am working on rss parser project, I need to fetch URL from us based server and store the data in to database while storing/viewing I need to keep the post time. I am using simplepie for rss aggregation, I face the following problem while handling rss while I am checking rss url in firefox 3.0.19/system timezone set to Chennai/Kolkatt...

Merge multiple doc or rtf files into a single doc or rtf file by using php script

Hi all, I would like to merge multiple doc or rtf files into a single file which should be the same format of multiple files. What I mean is that if a user selects multiple rtf template files from a list box and clicks on a button on web page, the output should be a single rtf file which combines multiple rtf template files, I should us...

Using xPath on SimpleXmlElement to get single string result

I am trying to get some data from a GoogleCheckout response. I am using a SimpleXmlElement and xpath to search for the data. One of the problems is that the response from xpath is an array of SimpleXmlElements - all I want is the string data. The other is that the response may contain multilpe instances of the TAG name - for example, ...

Generate Random Weighted value

Edit: I've rewritten the question in hopes that the goal is a little clearer. This is an extended question to this question here, and I really like the function provided in this answer. In the answer above, one is able to set the probability of hitting an extreme, with higher numbers producing a higher probability of getting lower numb...

Crop part of image in php and resize it

I have a source image (can be any image with and have different dimensions). I want to be able to tell php an area from the image to crop out and resize. For example: The source image is 800x800 pixels. PHP selects a 50x50 pixel region of the image with the selection area starting 80 pixels from the top edge of the source image, and 10...

Forcing CodeIgniter to execute hooks functionality?

Hi I am facing a problem with hooks in Codeigniter.I have written hook for 'post_controller' which call a Controller function and load the template (Layout view template).It works fine for all normal cases. But now i need to make a custom error page.So i am overriding show_404() function.In this function i use the get_instance(); functi...

how mvc+smarty in php works?

this is a handler for building menu new MenuItem('Owner', lang('Owner'), assemble_url('Owner'), get_image_url('navigation/Company.gif')), new MenuItem('Client', lang('Client'), assemble_url('Client'), get_image_url('navigation/people.gif')), One system module class in which i've mapped the route $router->map('Owner', 'Owner','nu...

Mysql_real_escape_string...is there an auto setting else where?

Hey ya all Got an odd situation here. On my local mysql database (v5.1.41), I am required to use this escape command if I am to handle users' quotation syntaxs without any problems. However I cannot use this command on my web server's mysql database (v5.0.91-community). If this command is used on the web server (apache v2.2.13), an ext...

How can I upload an image from source URL to some destination URL ?

Folks I have an image at some server (SOURCE) i.e. http://stagging-school-images.s3.amazonaws.com/2274928daf974332ed4e69fddc7a342e.jpg Now I want to upload it to somewhere else (DESTINATION) i.e. example.mysite.com/receiveImage.php First, I am copying image from source to my local server and then uploading it to destination. It's perf...

passing variables from php file to anther

How to pass variables from a php file to another while it is not html inputs ,just i have a link refer to the other file and i want to pass variables or values to it Example: File1.php <?php $name='OdO'; echo "<a href='File2.php'>Go To File2</a>"; ?> File2.php <?php echo $name; ?> ...

Facebook like button title on page

Hello I have a like button set up on my app. The link to one of the pages in the app is http://apps.facebook.com/heyulike/post3.php?id=4 If you click on the like button and then check your profile, you will see something like : Name likes Cool Pos on heyulike Everything is fine about this except in my php code, after Cool Po...

Import Uni-code formated text in CSV file using php

I want to import some data to a .CSV file. Some of the field contents are uni-code formated. But when I save .CSV file, it doesn't put them in orginal format. it keeps them using some special character. For what when I import the same .CSV file to database it can't read the uni-code formated data. Anyone can help me, if have a right a...

How to render the uploaded photo in a movie?

You have certainly seen sites where you upload a photo of a person, and it is mixed in a video at various places with various effects. I am wondering with what technology is done that, and what steps the process takes? For example you can check this site: http://j.mp/bbe8o8 ...