I am to import a file, say june.txt that would have data such as the following data:
Sandy,820,384,133,18,408
Wanda,120,437,128,807,595
Jane,631,415,142,687,600
Andrea,179,339,349,594,986
Wanda,803,191,6,807,322
Jane,741,975,34,15,832
Jane,239,714,250,94,497
Andrea,219,188,411,584,713
And t...
How do I specify the content type of a specific part of a multipart/form-data request? The content type for the image is being sent as application/octet-stream, however the server is expecting it to be image/jpeg. This causes the server to deny my request.
$data["file"] = "@/image.jpg";
$data["title"] = "The title";
$data["description"]...
I use software called DotNetPanel (DNP) and I'm modifying PHProxy to automatically log into the administration panels for me. I've done this for several other types of software - like cPanel - just fine using authentication headers or POST variables, but DNP uses something I'm not familiar with - ViewState.
When I POST the user/pass d...
I have a string with this html:
<div>
<span> 1 </span>
<a href="#"> <span> 2 </span> </a>
<a href="#"> <span> 3 </span> </a>
<a href="#"> <span> 4 </span> </a>
....
</div>
how do I remove the <span> tags from inside the links (<a>) ?
...
I've been reading about drupal install profiles, and I'm wondering if there's much of a difference between using a packaged install profile vs. installing core + manually installing the modules listed in the install profiles?
I'd like to do the latter (manually installing each) to control the versions of each module installed, which I ...
hy,
Let's say I want to convert an image to an exact size, eg: 400x300. The trick is, if the image, due to its aspect ratio, does not fit in 400x300, then place it in there with black borders.
A 900x1200 image would be converted down to 225x300 to retain its aspect ratio, and then given black borders left and right to make it 400x300.
...
I have recently become an intern on a startup online classroom system. So now, I'm scrambling to learn the system, and get to know the code for the program, which is written in PHP. This program spans around 3000 PHP files and associated images, html pages, CSS files and so forth, across over a hundred folders.
I was wondering if there ...
Hi everyone,
I am creating an ecommerce site that uses the payment gateway DPS. The payment gateway just takes a users details and returns whether the payment was successful or not.
I am just wondering if anyone has any good resources for how to make a really robust payments page that can handle large volumes of transactions safely. Ar...
I need a simple markup language to store different parts of a string on a TEXT field, and then extract those parts.
So basically I want some kind of simple XML. Storing those in the table field is easy, but extracting them... is other matter.
I managed to do so using a simple regex done for regular HTML:
|<[^>]+>(.*)</[^>]+>|U
But in ...
I'm experimenting with the Doctrine ORM (v1.2) for PHP. I have defined a class "liquor", with two child classes "gin" and "whiskey". I am using concrete inheritance (class table inheritance in most literature) to map the classes to three seperate database tables.
I am attempting to execute the following:
$liquor_table = Doctrine_Core::...
Hi everybody,
i just have a php array with number that i've "explode" to separate itens,
$arr = array($_POST["fname"]);
$arr = explode(',', $_POST['fname']);
$parentesis;
$parentesis2;
for ($i = 0; $i < sizeof($arr); $i+=2){
`$parentesis = substr($arr[$i], 1);`
`$parentesis2 = substr($arr[$i+1], 0,-1);`
actually arays...
I have two items, A and B. You can only have a maximum set of 2 items at any one time. This results in the following combinations:
A B
1 0
2 0
0 1
0 2
1 1
If you want 3 or more items, the remainders spill over into a new set. Sets of 2 are preferred over single items in a set. Examples:
2 lots of A and 1 lot of B (total 3 items) wou...
Hi,
Problems:- Whenever I try to select all tables in a database the connection is just lost and unknown error is given by the server to the browser and the browser just reloads with its own error page stating that the server gave unknown error. (This is in phpmyadmin)
I tried to solve this by adding max_allowed_packet to my.cnf first ...
how to make the response result at sEcho become not zero?
{"sEcho": 0,
i've been use this code but result still zero..
$sOutput .= '"sEcho": '.intval($_POST['sEcho']).', ';
...
I'm getting a Notice: Undefined offset: 0 error in my code, however I can print_r the element I am trying to get and its clearly defined.
function get_members($entries_found) {
$members = $entries_found[0]['member'];
...
}
If I print_r($members) I get the expected output, however I'm still getting the Notice.
Any clues?
...
Hi,
I'm trying to send email using php pear email package but I don't know how to set the headers correctly to send the content as html . I currently have :
$headers = array (
'From' => $username,
'To' => $bid_email,
'Reply-To' => $seller_email,
'Subject' => $subject,
'MIME-Version:' => "1.0",
'Content-type:' => "text/htm...
Hi,
I am trying to remove following tag from string.
[caption id="attachment_9" align="alignleft" width="137" caption="test"][/caption]
How do I remove it using php's preg_replace?
I tried serveral regular expression, but failed all.
Please advise me.
Thanks.
...
I'm getting a return string from a merchant account that looks like:
RecurringID=8675309&RefNo=41:39&Notes=
so I parse it into an array like this:
$results = array();
$temp = explode('&', $temp);
foreach($temp as $line)
{
$line = explode('=', $line);
$results[trim($line[0])] = trim($line[1]);
}
The resulting print_r($result...
hi to all
I have a problem with my website. I don't why the index.php was being inserted with the script below. This index.php is part of codeigniter, the framework that I was currently used. Is this inserted thru accessing ftp or thru code. After I was deleted this script I noticed that on the lower left of my browser there is another ...
hi all..
can you tell me what is the function of intval?
and what about this?
'.intval($_POST['bla']).'
...