When linking to a resized image by PHPThumb to popup in a lightbox using either thickbox or colorbox, I am getting a lightbox come up with data and characters. I am guessing because thickbox does not see my image as a real image because it is outputted with the php extension:
includes/phpThumb/phpThumb.php?src=includes/kcfinder/upload/...
In my project, say I am instantiating a class named SubClass, which extends an abstract class named AbstractClass. At the top of my files I include a file named bootstrap.inc, which includes AbstractClass in every file. Then, when I need it, I include SubClass which does not contain an include to AbstractClass.
If I include AbstractClas...
I have a page (page1.php) where I am using a select box to load in another page (page2.php) into a DIV. Inside page2.php there is a UL that loads data from a database (via PHP) into LIs and the are sortable.
My problem is, when I load page2.php by itself, it serializes fine. However, when page2.php is loaded via .load() into page1.php, ...
After finding the Hyde static website generator, I got to wondering,
Is there a similar tool written in PHP?
...
Mysql errors are among the most common ones you see during development, and I am searching for a pleasant and informative way to output them.
phpMyAdmin apparently has a decent pretty-printer for mySQL queries:
However, it prints errors as simple text:
Whereas in the latter example, the text after for the right syntax to use near ...
If I have a PHP class such as this one:
class A
{
public static function Method()
{
return "x";
}
}
I know that I can access this with:
echo A::Method();
But how would I go about creating a function reference to this method? I tried something like this:
$func = "A::Method";
echo $func();
But it gives me a run...
I am using DOMDocument for xml file validation. It takes more than 30 minutes in validating a 67MB xml file. Is there any other way to improve this checking time?
...
Hi,
I'm currently working on a SaaS type application, and for multi-tenancy I've settled on one database per user, with each database containing all tables required by the functionality the user is entitled to (have payed for).
The application is designed to capture data (i.e. like web analytics) and present it for the user. The design ...
Hi ,
How do select row in table ?? suppose table has ID and Name
if I select first row and middle row and click on submit button, How to display selected values ?
...
how do I spoof a referrer ?
originalsite.com has
header("Location: http://www.example.org");
I tried putting header("Location: http://www.destination.com"); in example.org
but checking the referer at destination.com, it shows originalsite.com as referer not example.org !
...
Here's a php code
if(isset($_GET['id'])) {
//do something
} else {
redirect('index.php'); //redirect is a function
}
Now if id is set (ex: index.php?id=12) then the action is performed but if id is not set (ex: index.php?id=) this shows an error, how to overcome this...??
How to determine id is an integer and it's not empty a...
When I link to a file in a directory, I want to open that file as a param in a php program.
For example, I have a directory temp, and files aa.txt, bb.txt, and test.php. When I link to aa.txt it should be handled like test.php?f=aa.txt.
What do I change in the .htaccess file?
the code in the test.php
<?php
$f=$_GET['f'];
if(@file_exi...
I am trying to spoof referrer.
A.com --> B.com --> Destination.com
A.com I have
header("Location: http://B.com/redirect.php?site='http://destination.com'");
B.com I have
$target = $_GET['site'];
header("Location: $target");
Destination.com writes the $_SERVER['HTTP_REFERER']; to a database where I can confirm if the refer spoof w...
I have this array:
Array
(
[0] => Array
(
[tag_id] => 1
)
[2] => Array
(
[tag_id] => 3
)
[22] => Array
(
[tag_id] => 44
)
[23] => Array
(
[tag_id] => 45
)
[25] => Array
(
[tag_id] =>...
I am considering using AHAH extensively on a project and am concerned about security. Couldn't an attacker inject malicious code into my response that would then be executed in the client? If my AJAX response is JSON, I don't have to worry about this because if things are tampered with the JSON will no longer be valid.
On the other hand...
I need to bind a SoapClient to a specific outbound network interface, but I cannot find any documentation on this. Is this even possible? If not, what are some possible workarounds?
...
ok so i have a php file that includes code for do a sql insert
myfile.php
include($somewhere.'/addleads.php');
addleads.php
require_once(MAIN_CLASS_PATH."common/class.Common.php");
require_once(MAIN_CLASS_PATH."modules/Leads/class.Leads.php");
$objcommon = new common();
$objLeads = new Leads();
$Errormsg = $objLeads->AddLBCle...
I'm trying to get the post-id my posts.
this is the format it is in--> postid-785645
the numbers are randomly generated.
<?php
$mysite = "http://example.com";
$wholepage = @file_get_contents($mysite);
// I want to use preg_match to echo just the numbers. out of the whole page.
// Basically i'm trying to have is search the whole page fo...
Hi all,
I'm new to web programing and im trying to find a few good examples / tutorials on how to do a decent job of creating a website that requires users to log on to view any pages beyond the main log in page.
so far i've found 1 or 2 that ive tried but i keep running into the same problem. If i just enter the url of the page i wan...
Is there a way if I count the number of tags inside the for loop for example.
if($tags == 0){
echo 'no tags entered.';
} else if($tags == 1){
echo $tags . 'tag entered';
} else {
echo $tags . 'tags entered';
}
Here is my code.
for ($x = 0; $x < count($tags); $x++){
if ($tags[$x] != '') {// get rid of empty tags
...