Hi,
I've been reading up on creating a PDF file with PHP and am wondering what the easiest option is.
1) Create a PDF template and then open it and replace placeholder text
-- which function do I use to open an existing pdf for editing?
2) Create a PDF template and the place text on it using co-ordinates
3) Create a html document th...
Hi ,
I want to find the attribute of the last node in the xml file.
the following code find's the attribute of the first node. Is there a way to find the last node ?
foreach ($xml->gig[0]->attributes() as $Id){
}
thanks
...
Hi,
I am trying to remove an element from a multidimentional array in PHP. Here is the code :
<?php
$tset = "ST3";
$gettc = "gettingtc1";
$getbid = "gettingbid1";
$getresultsid = "gettingresid1";
$users[$tset] = array();
$users[$tset][] = array( "testcase"=>"$gettc",
"buildid"=>"$getbid",
...
Wordpress is rendering an RSS feed at http://myurl.com/feed/rss/ but of course there's not actually a file there. I'm writing a script to read and render the RSS, but loading the "file" as XML fails, because there's not actually a file there. I write:
$rss = simplexml_load_file('/news/feed/rss/');
And I get this error:
Warning: simp...
Is it possible to fetch posts matching categorie x "AND" tag y?
Read the docs, it seems you can do:
query_posts('tag=bread,baking');
or
query_posts('cat=2,6,17,38');
... is it possible to use both cat and tag simultaneously?
...
I'm writing a PHP function that will delete all the files in the directory that's passed to it (and eventually, possibly expand it to a recursive delete). To be safe, I want to make sure that, through a bug or something, I don't try to delete anything if the directory passed in is the root directory.
File permissions should protect me ...
Hello !
I have an array:
$array = array(
'key1' => 'value1',
'key2' => 'value2',
'key3' => 'value3',
'key4' => 'value4',
'key5' => 'value5',
);
and I would like to get a part of it with specified keys - for example key2, key4, key5.
Expected result:
$result = array(
'key2' => 'value2',
'key4' => 'value4',
'key5' => ...
i'm using this code:
but doesnt seem to work because the structure of my html file has 3 frames, a sidebar, title, and the main.
Now, the user will have two buttons, the call new sidebar. Which is only accessible if he has logged in. And the other button is log out.
When the user press the call new sidebar. The sidebar will change into ...
I'm writing a semi-simple database wrapper class and want to have a fetching method which would operate automagically: it should prepare each different statement only the first time around and just bind and execute the query on successive calls.
I guess the main question is: How does re-preparing the same MySql statement work, will PDO ...
Hi,
This is a quick question relating to Symfony, but could be a general MVC question.
I have a class in my model, for example, WebUser. This class has a property of email_address. This value must be unique to each WebUser.
Now, I've made it so all my Symfony forms validate that the email_address is unique for the given WebUser, howev...
HI everyone
1.
As user enter username and password in sign-in-form.php then values are collected in sign-in-action-form.php page and the i am storing username into session variable like this
In database i have a table named employee
<a href="logout_file.php">Sign Out</a>
if (username and passwords are matched)
{
session_start();
$_SESS...
I can display posts from featured category like so:
query_posts('tag=featured');
... but is it possible to further sort it using a dropdown/select menu:
<select name="">
<option value="reviews">Reviews</option>
<option value="articles">Articles</option>
<option value="interviews">Interviews</option>
</select>
... so when one ...
I trying to make a realtime stats bar.
And I think of using the Long Polling concept.
But when a request is send to php.
I need a way of testing if the stats are updated.
Now I can just make a loop with a database query, and test it.
But that just doesn't seem right to me :)
Is there a more inexpensive method of testing the database f...
Is it possible to catch exception and continue execution of script?
...
Hi,
I have a webform that allows our agents to upload a pdf attachment that later gets emailed out to our customer. The code I use to build the email I found on a website and it seemed to work well until recently. It seems with some (only a few, gmail for example) mail-clients the attachment is printed out to the body of the email inste...
Please try to search StackOverflow before asking a question. Many questions are already answered. For example:
PHP & MySQL compare password
how do I create a mySQL user with hash(‘sha256’, $salt . $password)?
Secure hash and salt for PHP passwords
User Login with a single query and per-user password salt
Non-random...
Hi, I've wrote a simple function to check if the string I send "should be" valid or not.
// this works without problems
function validate_email ($value) {
return preg_match ("/^[^0-9][A-z0-9_]+([.][A-z0-9_]+)*[@][A-z0-9_]+([.][A-z0-9_]+)*[.][A-z]{2,4}$/", $value);
}
// this doesn't work
function validate_string ($value) {
retu...
(Sorry if the title is pretty useless)
I have this function to get the first image from a random post in WordPress. This works great, but now I need it to select a random image from all the matches, rather than the first.
(I'm running this function in a query_posts loop to select the categories)
// Get first image in post
function catc...
Is it a good idea to name important tags with # prefix eg #reviews, #articles (somewhat like the twitter hashtag) to separate them from thousands of regular tags?
What would be its effect on SEO and will the '#' be stripped when used in a URL?
...
As you know when Magic Quotes are ON, single quotes are escaped in values and also in keys. Most solutions to remove Magic Quotes at runtime only unescape values, not keys. I'm seeking a solution that will unescape keys and values...
I found out on PHP.net this piece of code:
$process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
wh...