I'm having problems with posting a multidimensional array with file uploads using PHP and CURL.
The multidimensional array is for example:
$post['question'] = 'Are you human?';
$post['answers'] = array('yes', 'no', 'maybe');
$post['file'] = '@/path/to/file';
// Output:
Array(
'question' => Are you human?,
'answers' => Array(
...
Very soon I will setting up a web server for a client who has a very busy site. He has a forum (run on Simple Machines Forum SMF written in PHP) that cannot really be changed. I want to move this to a separate virtual private server on it's own, as it's very busy at around 40,000 hits a day with 400+ posts a day. With the version of SMF ...
I want to generate a large (~2 kb), random, unique block of random text for use as an authentication token. Standard hashing functions produce results that are too short. Would it be OK to use openssl's private key generation function or is there more appropriate solution I should look at?
...
Hi all,
Sorry if this is blatantly obvious, but I've Googled this and I seriously cannot find any PHP-only way to do it.
Without using an HTML or Javascript - pure PHP only (from a Controller file in a CodeIgniter site) - how can I open a browser window with a link I specify?
Is it possible?
Thanks!
Jack
Edit: it seems some people ...
I'm building a website that constructs both site-wide and user-specific activity feeds. I hope that you can see the structure below and share you insight as to whether my solution is doing the job. This is complicated by the fact that I have multiple types of users that right now are not stored in one master table. This is because the...
I'm self-taught php programmer, so I often don't know the "correct" way to do something. I want to normalize my character encoding practices between my PHP, HTML, and MySQL data.
-- live in the US,
-- work on sites for people who speak English,
-- most foreign languages I will encounter are western (Spanish, Italian, French)
-- living...
I have a php page and want to write a link that is based on the current URL. Like so:
$alias = substr(strrchr($_SERVER['REQUEST_URI'], "/"), 1);
print '<a href="'.$alias.'&sort=name">Sort by Name</a>';
On the page http://domain.com/listings , the link is written to http://domain.com/listings&sort=name , which works perfectly.
B...
I have recently upgraded to Ubuntu 10.04 and as usual installed xdebug from the package manager. I've never had a problem after that with getting the formatted error messages and var_dumps to show up but this time they don't.
I ran phpinfo() and it is definitely loading it, and I even tried running some of the custom xdebug functions an...
Hi,
I'm trying to build a site that does not rely on the user enabling 3rd party cookies.
For some reason, I'm noticing null $_POST variables from a simple only in Firefox and Chrome when 3rd party cookies are blocked (IE is fine). This is only with POST. The GET variables from the same script store the data normally.
I have set IE ...
I try to avoid doing Count() because of performance issue. (i.e. SELECT COUNT() FROM Users)
If I run the followings in phpMyAdmin, it is ok:
SELECT SQL_CALC_FOUND_ROWS * FROM Users;
SELECT FOUND_ROWS();
It will return # of rows. i.e. # of Users.
However, if I run in in PHP, I cannot do this:
$query = 'SELECT SQL_CALC_FOUND...
I am new to php and am trying to build a website. I would like to logout user session if he is idle for some time. I searched the web but i couldn't find the proper code. How do you check whether user is idle or not in php?. Can anyone help me please.
...
I have two hidden fields in the form (php) where these hidden fields are being replaced
These hidden fields have the value from two text boxes.
So we are getting the values directly from the textboxes in the action form
<input type ="text1" name="text1" value="">
<input type ="text2" name="text2" value="">
<?php
if(!empty($_POST['te...
I often need to create html admin interfaces to administer data in tables. In other words, a page that lists all the records and lets you step through multiple pages of records, and perhaps sort or search them, along with the ability to add or delete a record, or update an existing one. Basic stuff.
I do not like to use big frameworks ...
I have the following statement which worked fine before PHP 5.3:
list($year, $month, $day, $hour, $min, $sec) = split( '[: -]', $post_timestamp );
After upgrading to PHP 5.3, I get the Deprecated warning of the title.
I am trying to parse a string with format like:
2010-08-10 23:07:58
into its component parts.
...
How to covert PowerPoint to video or flash in php? Or how would I call a process like this in unix
Thanks!
...
Hi, hope someone can help as I'm not sure what's going on here - I have a live site where I want to allow file uploads of over 2MB. I have set the standard config options in php.ini as follows (running phpinfo() shows these settings fine):
upload_max_filesize 25M 25M
post_max_size 25M 25M
max_input_time 60 60
memory_limit 32M 32M...
Hi all.
I'm trying to parse this feed: http://musicbrainz.org/ws/1/artist/c0b2500e-0cef-4130-869d-732b23ed9df5?type=xml&inc=url-rels
I want to grab the URLs inside the 'relation-list' tag.
I've tried fetching the URL with PHP using simplexml_load_file(), but I can't access it using $feed->artist->relation-list as PHP interprets "l...
Alright I am trying to set up an OAuth Provider in PHP, but I just cannot get the hang of it. I've been referenced to this page a number of times, but I cannot wrap my head around it. Could someone help me out, step by step, or reference me to a more direct guide? Thank you very much.
...
I've been making "Product Object" for my app and I've been setting attributes, when suddenly I got to price attribute and stumbled upon it with question what type better to choose? I understand, that for PHP it doesn't matter so much, but lets say for MySQL it does.
Any suggestions?
...
Hello,
I store all datetime values as unix timestamp. Registered users can set personal GMT locale in their profile. What should I do to display all datetime on website in user's GMT locale?
Thank you
...