php

Access $classA from $classB when $classB is called from $classA->__construct()

I think my title about says it all. During the __construct()-tion of $classA, $classB is instantiated. When $classB is instantiated it needs to access to another class inside $classA (i.e. $classA->classC). $classC has already been instantiated in $classA. Inside the __construct() function of $classB I am attempting to do something like...

PHP: mysql_query INSERT INTO grab id?

so i have this: mysql_query("INSERT INTO..."); I was wondering after you've inserted if you could echo out the id of the column you have inserted, or should i SELECT and that all around again? ...

Anonymous User Counter for Viewing Images

I'm just starting with PHP. I'm currently building a site that will allow anonymous users to view images ten times a day. Any image viewed will increase the counter as well viewing a certain image more than once. Viewing more than the counter limit per day will not be allowed unless they register. Just wondering what can I do with sessi...

How to get started using SwiftMailer

I wanna use swiftmailer to send the results of a form to a gmail account. I'm new to php (and new to ubuntu), and in the stage of being (embarrasingly) lost even when reading the documentation. Questions: a) Where do I extract the library? I placed it on my desktop. Shouldn't it go in some apache folder? b) How would a sample messa...

PHP stuck in safe_mode

Even though I've set safe_mode = Off in php.ini, restarted apache, and even rebooted the system... when I try to execute set_time_limit(0) in my application, it throws the warning that set_time_limit cannot be st in safe mode. This has been erratic behavior; earlier when I set safe_mode to Off, the system worked fine. But later ...

Need Tutorials for Writing a Login API

Hey, I'm pretty new to PHP, but I've got a site up and running with a full login/registration script, etc... I have found ample tutorials on sending data via HttpRequest and getting XML or JSON data back--so I'm pretty comfortable with that. I can't seem to find any information or tutorials on how to write the script that handles tho...

Aligning Text Vertically to the Top Next to New Twitter Button

I am trying to add the new twitter button to one of my Wordpress templates. For an example, see here: http://johnkivus.com/2010/08/12/if-you-build-it/. I want the text aligned with the top edge of the button instead of the button. The code section that puts the twitter button in place is as follows: <div class="postmeta"> ...

Why the code below returns the same stuff?

var_dump(implode(',', array('11','22'))); And var_dump(implode(array('11','22'), ',')); Which is right? ...

NetBeans-Xdebug works, but won't expose some PHP variables

UPDATE -- working on getting WAMP with phpDeveloper/Xdebug going. I still want NetBeans -- I just want to compare, see if I get some insights. I am using NetBeans 6.9 with LAMP and Xdebug to work on PHP code. The Variables display works well, but lately it works less well. For example below, $authorized should be visible in the Var...

PHP CodeIigniter - PDF generator

Need help in PDF generation because I am doing a project with PHP CodeIgniter. I need to convert some HTML documents (of min 10 pages) into PDF. I heard that wkhtmltopdf is good compared to others. But how to incorporate it into the web pages, since I see it as command line converter. Any example would be more helpful or any suggesti...

Open a PHP page/initialize Session Variables Simultaneously?

Hello again! I'm pretty new to PHP and JSON/XML, but we're forging ahead. Our project entails logging in to a webservice (which we also built) from a handheld device and then accessing our website from that device. The point is to only allow users who have logged in on the handheld device to access the webpage. Now, I guess this does...

php encrypt question

Here's the story: I have to pass some classified information from one script to another script. In the first script I need to encrypt the data first and then I HAVE TO attach the encrypted data into a GET request and send it to another script, the url would look like this : http://mydomain.com/mysecondscript.php?secret={encrypted st...

Variables in an array

Hi everyone, I'm trying to put a mysql query into a function, however when I do a mysql_fetch_array I need to specify the row's name. How can I put a variable in a function? function config($setting_name,){ while($config_db = mysql_fetch_array(mysql_query("SELECT {$setting_name} FROM config WHERE id='1'") { echo $config_db['...

PHP & MySQL special character encoding problem.

When a user submits a special character &spades; it's stored in MySQL database as â� and if a user wants to change it instead of displaying it back as &spades; its displayed as â� how can I fix this problem so that its dsiplayed back as &spades; and saved as &spades;? On a side note how should I save my special characters using PHP? I'...

How to download multiple files together from a database in PHP

I know how to download a single file from a database in PHP. How can I download multiple files together from a database? ...

PHP and IRC and Shells

I'm working with a closed community site (PHP-based) of about 100 users, and one of the features we've implemented is an ajax shoutbox that works as a "chatroom" on the site frontpage when users logged in. The dev team is using a private irc server for collaboration, and in one channel we're running a quizbot. We came up with the idea to...

Intelligent date range parsing of human input?

Has anyone come across a script / cl app written in any language that handles the parsing of human-entered dates well? I'd love to be able to parse, for example: "3 to 4 weeks" "2 - 3 days" "3 weeks to 2 months" ...

how to enable the Customer Information Manager (CIM) in authorize.net?

hi When i am storing the credit card information in customer information manager its showing "E00044Customer Information Manager is not enabled" error. How to solve this problem? ...

php mysql check db first

<?php $thesite = strip_tags($_GET['s']); $original_file = @file_get_contents($thesite); if ($original_file === false) { die("$thesite does not exist"); } elseif($orginial_file === true ) { $data = $path_info['host']; $check = mysql_query("SELECT * FROM first WHERE name='$data'"); } else { //step3 } I want to check the...

PHP - How to prevent user from logging in from multiple machines at the same time?

Hello all, Is there a way that I can prevent a user from logging into a system from different machines at the same time? Thank you ...