I have set up PDFTK so that I can rotate a pdf 90 degrees to print it landscape mode. Have had no luck rotating using lpr, so I am trying to rotate before I send to the printer.
Once I use PDFTK the created PDF files appears to be rotated perfectly. It then gets translated into a postscript file, using pdf2ps, and when it is sent to th...
I need to get two factors ( x, y ) of a given number ( n ) such that:
x * y <= n
x * y should be as close to n as possible
x and y should be as close to each other as possible.
Examples:
n = 16 => x = 4, y = 4
n = 17 => x = 4, y = 4
n = 18 => x = 6, y = 3
n = 20 => x = 5, y = 4
Any language will do but preferably php.
EDIT -- CL...
Hey Guys,
I'm trying to return the files in a specified directory using a recursive search.
I successfully achieved this, however I want to add a few lines of code that will allow me to specify certain extensions that I want to be returned.
For example return only .jpg files in the directory.
Here's my code,
<?php
$it = new Recursive...
So I had an issue last night when I went to upload a project I've been working on locally to my server.
I had this:
require_once "/../controllers/source/MySpaceID/myspace.php";
Which is the correct path to that file finding its way out of the libraries folder. It worked fine until I put it on the server. Any thoughts?
...
I need to merge several arrays into a single array. The best way to describe what I'm looking for is "interleaving" the arrays into a single array.
For example take item one from array #1 and append to the final array. Get item one from array #2 and append to the final array. Get item two from array #1 and append...etc.
The final a...
Hello!
Is that possible that with cURL not every user use the same cookie?
Because it's cool that I store the cookie that I get, but this cookie will be used by everybody, and it should be, because it's a login cookie.
Charlie
...
I want to copy or move the .flv file stored on Flash media server using php script. I am having the rtmp path. I am not able to connect to the FMS server using the rtmp path.
...
I've got a simple class which returns results from select classes. The db user only has select privileges.
The class is made available through SOAP so 3rd parties can query the database to create reporting tools.
The problem is the PHP SoapClient throws a SoapFault exception when I try to select too many rows. On a table with about...
hey Guys,
I know this question is probably straightfoward but I'm new to php and programming...
I want to write the results of a recursive search to a text file, and also ensuring that any other search performed will not overwrite the exisiting data, but add to it.
here is my code:
<?php
$it = new RecursiveDirectoryIterator("L:\fol...
I am having a bit of trouble understanding this bug.
Here is the code:
function filter_optionsfordash(array $data,$dash) {
$filtered_options = array();
$len = strlen($dash);
foreach ($data as $k => $value) {
if (substr($k,0,$len) === $dash) {
$option_name = trim(str_replace($dash . '_','',$k));
s...
I posted on the Carabiner wiki but wanted to see if anyone here was able to get Carabiner for CI cache working, no matter what i try it will not write the cache to the folder, and I gave the folder 777 permissions. Has anyone else had this issue?
...
I'm trying to validate a generic contact form that's provided by my CRM unfortunately they control the server side script that puts the information into the CRM.
The name of some of the form fields have spaces in them. How can I accommodate for that?
if ( document.contact_form.First Name.value == "" )
{
alert ( "Pl...
I have a hosting account on a USA based server. I want to produce an output file with a date/time that is local for me ( in England, UK).
How do I convert the date/time to my local time, and cater for day light saving when appropriate.
thanks
...
I have php scripts that I have to run on linux as well as on Windows servers.
I want to use the same scripts without doing any modifications for those 2 environments.
Theses scripts will be scheduled with cron (on linux) and with the windows scheduler (or other, I don't care for now) for my Windows environment.
However, some of theses ...
while($tag = mysqli_fetch_assoc($result))
{
$arrayresult[$tag['id']][$tag['name']] = $tag['count'];
}
the $result contains 4 rows from database table.
i want it to be like:
$arrayresult[1]['mac'] = 34
$arrayresult[22]['pc'] = 32
$arrayresult[31]['windows'] = 14
$arrayresult[4]['linux'] = 23
the code above doesnt seems to work...
I got a PHP login page, where the user fills in username and password, if it's correct, the page loads some information such as user_id to a session variable.
After loading it to the session it's making a header('Location') redirect.
(The redirection is to the same domain.)
(All pages have session_start(); )
Somehow the next page doesn'...
I have a 1 pixel tall by 760 pixel wide image that I use as a repeating vertical background image. The right side of this image is filled with a spot color (the remaining left side of the image is white).
The purpose of this background image, in my css based layout, is that it provides the illusion that the sidebar background color runs...
Hi All,
I did some searching and was not able to find any information regarding this implementation versus every other one I have seen.
function sieve($top)
{
for($i = 11; $i<$top; $i+=2)
{
if($i % 3 == 0 || $i % 5 == 0
|| $i % 7 == 0)
{
continue;
}
echo "$i <br /...
Here is the javascript:
function checkusername()
{
var username = $("#username").val();
$.post("usernamecheck.php", {'username':username},
function (data){
if(data == 'taken'){
...
I'm trying to download a file through my server to me, by streaming the download.
This is my script:
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=http://user:[email protected]/file.bin';
header('Content-Transfer-Encoding: binary');
heade...