Hello! I need to run inkscape in PHP so I can convert an svg image to PDF. However every time I try:
//some PHP code
system("inkscape -z --file=svg.svg --export-pdf=pdf.pdf");
//more code
I get no new file and I get this in the apache erro log.
(inkscape:28607): libgnomevfs-WARNING **: Unable to create ~/.gnome2 directory: ...
Hello,
I want to convert the perl function below to PHP function, if someone could help a little bit I'd appreaciate it:
sub encode32
{
$_=shift;
my($l,$e);
$_=unpack('B*',$_);
s/(.....)/000$1/g;
$l=length;
if($l & 7)
{
$e=substr($_,$l & ~7);
$_=substr($_,0,$l & ~7);
$_.="000$e" . '0' ...
Hi,
I am having trouble in understanding of how I need to do this:
Have list of items on my home page and when users click on that, I take them to a page where i ask for name and email id(both are optional fields) and when users hit submit, I will take them to other page where they get to see all the details. the reason for that name ...
I have alphabet array 24 character: "A B C D E F G H I J K L M N O P Q R S T U V W X"
I want collect all case with: 3 unique characters.
First case: ABC, DEF, GHI, JKL, MNO, PQR, STU, VWX
...
I'm testing the Drupal services module and it's working fine. I now switched from no key to a key authentication, and the system generated this key for me afw92iej83foijofn23.
When I inspect node.get at http://localhost/drupal/admin/build/services/browse/node.get I see that it now needs 4 extra required parameters stringhash, stringdom...
I get this error when using the rename function
Warning: rename(../data/feeds/feed2.txt,../data/feeds/feed3.txt) [function.rename]: No error in C:\wamp\www\cms\admin\pages\feeds.php on line 32
"../data/feeds/feed2.txt" is the correct path, I have done include("../data/feeds/feed2.txt") and it displays the file. And "../data/feeds/feed...
Is there a sort of reliable way to programmatically create MySQL databases and MySQL users on shared Linux hosting plans from a PHP page? For instance, accessing cpanel or phpmyadmin through an API or hook if I know my cpanel access information and/or my FTP information?
Occasionally I see this with some sites and products but don't kno...
On Linux-based shared hosting that is administered with cpanel, is there a programmatic way to create, sort of reliably, addon domains for my site if I know my cpanel login information and/or FTP information?
Note: interested in PHP and cpanel in this case.
...
I'm loading files into a table with php. I create a table like this:
CREATE TABLE IF NOT EXISTS $table (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`order` INT DEFAULT 0,
`data` VARCHAR(200) UNIQUE KEY,
`cur_timestamp` TIMESTAMP DEFAULT NOW())"
And fill it from a text file like this:
LOAD DATA LOCAL
INFILE '".$file ."'
REPLACE INTO TABLE...
I am very new to PHP, so far I have been using the following schema to connect to a database server and select a database:
mysql_connect("host","username","password");
mysql_select_db("databaseName");
But now I am using some one else's script and it seems to be written in Object Oriented style. So I am at a loss as to how to edit the ...
Building a web app that includes several contentEditable divs. The users add stuff to the div's, clicks the save button, which saves all the data from each div to a json object. That goes through JSON.stringify to a mysql database as a TEXT (uploaded with php via mysql_real_escape_string() ). When loaded it goes back to JSON.parse and th...
Hi everybody,
When looking back at last weeks work (identical to many others), I've found myself spending the major part of my time putting together forms of which POST-data are used to perform database CRUD operations through my MVC-models.
When reflecting over this, it becomes a bit worrying. It's not really appropriate to spend the ...
Hi all,
I have a basic form consisting of input fields as well as a file field. I have a few things that I want the form to do. Collect the information (obviously). There's also an option to upload a file, (probably .doc,.pdf,.docx), so I want to restrict the attached file only to those extensions and under 2MB. All I know is that I hav...
Hi everybody,
I am working with a CMS for a web app in PHP, that has the needs of shortening the process for inserting (embedding) stuff, like a video from youtube or vimeo by wroting the following, which are stored in the database:
<youtube id="wfI0Z6YJhL0" />
Which would output the following after some sort of replace:
<!-- Custom...
Hello,
I'm working on a template class and I've an issue when trying to parse out a list of quoted strings from a string argument list. Take for example the string:
$string = 'VAR_SELECTED, \'Hello m\'lady\', "null"';
I'm having a problem coming up with a regex that extracts the string "Hello m'lady" and "null". The closest I have go...
Hiya.
how do I print the an attribute of an element?
example:
$doc = new DOMDocument();
@$doc->loadHTML($page);
$xpath = new DOMXPath($doc);
$arts= $xpath->query("/td");
foreach ($arts as $art) {
here i wanna print the attribute class of the td element, how do i do so ?
}
...
Metaphone and Soundex are phonetic algorithms for indexing strings by their English pronunciation.
Have you ever used functions metaphone() or soundex() that are present in the standard PHP library?
What for? What are real-life usages of these functions?
...
Hello,
I have a function for sending mail from PHP and I want to be albe to send Czech letters, like ř,ě,š,č,ř,ž,ý,á,é ..
The function goes like this:
function sendMail($to, $from, $subject, $body) {
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
$body = iconv("UTF-8", 'ISO-8859-2', $body);
$content = "<ht...
hello,
i am trying to make short url or even pretty URLs inside my wordpress. suppose, i have a the_content filter that finds all external links inside post content, it needs to return short or pretty urls relative to my site URL.
external url:
stackoverflow.com/questions/ask
pretty url:
myblog.com/xyxd
making url is not ...
with NO .htaccess in place, all requests to /login go straight to /cart/register which then goes to /cart
no code in any of those files gets executed (PHP files)
there is nothing in the httpd.conf referencing "login" or "cart"
Any help would be MUCH appreciated!
...