Can someone help me with this,I'm stuck.Dont know why this dont work
$myPath = get_bloginfo('wpurl').'/wp-content/uploads/'; // this is full path
function ReadDirList($d){
$dir = opendir($d);
$fs = "";
while($folder = readdir($dir))
{
//if(is_dir($folder)){
$fs = $fs. '<option>'.$folder.'</option>';
...
Im using the Zend Lucene however Im have a little trouble. I wish to query the index for the exact tring so page_name IS test123, not any fuzzy match.
Currently I have:
$hits = $index->find('page_name:"test123"');
And advice appreciated, thanks!
...
I have run into a very interesting problem trying to debug my custom php session handler. For some reason unknown to me I can set cookies all the way through the session handler right up until the very start of the write function.
As far as I know session handler calls go in this order.
open -> read -> write -> close
The open function...
Hi there,
I have readed about how to prevent CSRF-attacks in the last days. I am going to update the token in every pageload, save the token in the session and make a check when submitting a form.
But what if the user has, lets say 3 tabs open with my website, and I just store the last token in the session? This will overwrite the toke...
Some time ago I made a script that takes some text and returns it as an image, and worked flawlessly. But I'm not sure since when a weird bug started to happen. The letters that have a (my apologies to the font geeks) "glyph" on the left get pushed to the right so the letter starts on it, but leaves space only for the main letter, hehe, ...
DOMPDF does not support floats.
However I am listing many tables, and they are mainly key & value pairs. I would like 2 of these tables to appear side by side.
i.e. if I could use floats
HTML
<table id="stuff">
...
</table>
<table id="other-stuff">
...
</table>
CSS
table#stuff {
float: left;
}
table#other-stuff {
float: ...
Update: solved this problem see answer
I want to make new posts on my blog remotely with XMLRPC api and i m trying to use metaWeblog.newPost function, because it provides much features.
I successfully added new posts into wordpress but i failed to post it in a defined category(categories)
i tried lots of various things but failed at en...
I'm trying to loop 2 variables and with an output that looks like this '91 - 96 lbs' I can get the For statement to work with just one variable but with two it does not work.
for ($k = 91; $k <= 496; $k=$k+4($i = 96; $i <= 500; $i=$i+4))
echo '<option value='.$k. ' - ' .$i. ' lbs'("<%m_weight%>" == .$k. ' - ' .$i. ' lbs' ? ' selected=...
I keep getting an the following error of Array to string conversion error on this line listed below. How can I fix this problem?
$skill = explode('', $_POST['skill']);
Here is the PHP & MySQL code.
$skill = explode('', $_POST['skill']);
$experience = explode('', $_POST['experience']);
$years = explode('', $_POST['years']);
for ($s =...
Hi all,
I found this code on the internet on how to to display message/pop up box.
<? echo "<script language=\"JavaScript\">\n";
echo "alert('$msg1')";
echo "alert('$msg2')";
</script>";
?>
AND
<? echo "<script>alert('$msg1' )</script>" <?
I want to display messages to the user by popup message. all the messages will ...
I need to change the folder that "relative include paths" are based on.
I might currently be "in" this folder:
C:\ABC\XYZ\123\ZZZ
And in this case, the path "../../Source/SomeCode.php" would actually be in this folder:
C:\ABC\XYZ\Source
And realpath('.') would = 'C:\ABC\XYZ\123\ZZZ';
If however, realpath('.') were "C:\Some\Other\Fold...
Do you know of any open source library or framework that can perform some basic validation and escaping functionality for a MySQL Db.
i envisage something along the lines of:
//give it something to perform the quote() quoteInto() methods
$lib->setSanitizor($MyZend_DBAdaptor);
//tell it structure of the table - colnames/coltypes/ etc
...
I just moved from an Ubuntu PHP workstation dev environment back to Windows and am using xampp. I have a bit of code, like so:
<input type="text" name="txtEmail" value="<?=$emailaddress;?>"/>
that I swear worked to display the variable in the textbox when I was developing before. But when I loaded the page on Windows/xampp it just p...
I am a college student taking a course in php and mysql progamming and my first question is about the "$variable" variables in the following code:
<?php ob_start(); ?>
<?php
session_start();
if ($_SESSION['auth'] != "true")
{ header("Location: login.php");
exit;
}
$uid = $_SESSION['user'];
$connection = mysql_connect("localhost",...
The code below works as far as inserting records from a file into MySQL, but it only does so properly if the columns in the file are already ordered the same way as in the database. I would like for the user to be able to select the drop down the corresponds to each column in their file to match it up with the columns in the database (t...
What can I do to make my PHP web application fail in a more noisy way?
I am using an MVC pattern and often when classes fail to load or failures they do so without error.
...
I need to find the value of a variable and use it to add a class to a div, based on a switch statement.
For example, my variable is $link and if $link has google.com IN IT at all, I need $class to equal 'google', if $link as yahoo.com IN IT at all, $class then needs to equal 'yahoo'
So, I need something like this, but I'm not sure how...
Anyone know how to get a random set of lines from a text file?
I want to get a set of 3 lines with
<br>
on the front of each and display them through html.
example:
set 1
<br>Hi
<br>what's your name
<br>goodbye
set 2
<br>stack
<br>overflow
<br>hi there
set 3,4,5....
Choose one random set and display it.
The sets of lines would be...
I am using phpbb on a site for a client, and the client has requested that each different forum page have a different background color.
Such functionality is not built into phpbb (from what I can tell), so how should I go about doing this? Can I modify the code of phpbb directly?
My other thought was to use a js conditional statement, ...
can one map all the application's objects to a UML map (maybe parsing through the code base) so one can have the objects visualized and see all the relations and the design patterns used?
...