php

I having a problem with the mysqli free() member function

Hi I have code where I connected to the database like so: $db = new mysqli("localhost", "user", "pass", "company"); Now when I query the database like so: //query calls to a stored procedure 'user_info' $result = $db->query("CALL user_info('$instruc', 'c_register', '$eml', '$pass', '')"); if($result->fetch_array()) { //use the ...

How to get an array of all controllers in a Codeigniter project ?

I'd like to obtain a list of all controllers in a Codeiginiter project so I can easily loop through each of them and add defined routes. I can't seem to find a method that will give me what I'm after ? Here is the code snippet from the routes.php file where I would like to access the array: - // I'd like $controllers to be dynamically...

Authorization error in facebook aplication

require_login($required_permissions = 'email,photo_upload'); $auth= $facebook->do_get_session($_GET['auth_token']); $facebook->set_user($s['uid'], $s['session_key'], $s['expires'], $s['secret']) ?> Fatal error: Uncaught exception 'FacebookRestClientException' with message 'Invalid parameter' in /home2/puneetbh/public_html/prideapp/faceb...

authentication in PHP ?

Hi guys, I need to make an authentication script in php. I have already made a login.php page, where the user can enter his unsername/password and it gets checked against a database. If the unsername/password are correct, the user should be forwarded to members.php page together with a $_SERVER['username'] variable. What is the command ...

check username and password vie ldap php

Hi all, I'm trying to connect to my AD server and check if username and password is correct when I'm trying to do that, It always tells me: Unable to bind to server: Invalid credentials My code is: $ldapconn = ldap_connect($adserver,$adport); $ldapbind = @ldap_bind($ldapconn,"$username","$password"); when I tried to set a username w...

What's the best way to store sensitive data in MySQL?

I'm managing the MySQL database from PHP scripts. the communication between server and client is secured via SSL. I store user account data which is sensitive. Is there a way to encrypt this data when entered into the DB? What is the best way to protect this sensitive data? EDIT: I’m using a CRON job for updating data which relies on t...

Host of Referer

How to find out the Referers host? My Problem is, i wont to check, is user from google adwords or organic search... so i checking refferer, but the refferer ist allways google organix search... if some one have a be´tter idea :) tell it. But I found out, that the HOst is a speacial one! So now I wont to check for Host of the Refferes s...

PHP header location redirect causing 500 Internal Server error

Hi, I I keep getting a 500 Internal Server Error when the script below reaches the header('location:php_email_thankyou.php'). Im not sure what is causing this, as I can place the header expression before or after the if statements and it works fine. In firebug it mentions a GET request for the php_email_thankyou.php page not sure if that...

PHP check http referer for form submitted by AJAX, secure?

Hi all: This is the first time I am working for a front-end project that requires server-side authentication for AJAX requests. I've encountered problems like I cannot make a call of session_start as the beginning line of the "destination page", cuz that would get me a PHP Warning : Warning: session_start() [function.session-start]: C...

Detecting .com / .co.uk etc etc

Hey all! I currently have a preg_match to detect http:// and www. etc..... but I want to detect domain.com or domain.co.uk from a string example string: "Hey hows it going, check out domain.com" And I want to detect domain.com What I want is to detect any major domains form this string i.e. .com .co.uk .eu etc... from the fo...

Magento - How do I create a shopping cart price rule automatically?

I'd like to create a shopping cart price rule that gives a user 10% off their order when and if they complete a process on my Magento site. There's a method here that inserts the rule directly to the database. That's a bit invasive for my tastes. How would I go about this using Magento methods? ...

CData section not finished problem

When I use DOMDocument::loadXML() for my XML below I get error: Warning: DOMDocument::loadXML() [domdocument.loadxml]: CData section not finished http://www.site.org/displayimage.php?album=se in Entity, Warning: DOMDocument::loadXML() [domdocument.loadxml]: Premature end of data in tag image line 7 in Entity Warning: DOMDocument::loadXM...

Regex : Matching phone numbers starting with NNN and having 10 numbers

I need to match phone numbers that : start with 010 or 012 or 016 or 019 Consist of 10 numbers exactly can you please help me on how to match numbers using PHP and regex thanks ...

Does Flickr "Know" if a Hotlinked Image Does Not Link Back to Source?

From Flickr's community guidelines: "Do link back to Flickr when you post your photos elsewhere. The Flickr service makes it possible to post images hosted on Flickr to outside web sites. However, pages on other web sites that display images hosted on flickr.com must provide a link from each photo back to its photo page on Flickr." Our...

AMFPHP Database Sessions

I am using AMFPHP w/ a Flex application and am needing to start storing the user sessions in the database instead of the filesystem. I've tried utilizing the session save handler function but no matter what I do it still ends up storing the files on the filesystem. Any ideas? ...

php imap_search SINCE date problem

I'm trying to show only the emails received in the last 5 min for example $since = date('d-M-Y G\:i', time() - 300); // current time - 5 min $mb = imap_search ($m_mail, 'UNSEEN SINCE ' . $since . ''); Is there an easy way to do this ? I find a way: take all the unseen mails for the current day (ex:9 may 2010), loop it and then checki...

Php/Javascript to make a browser game?

I've been on and off intrested in making a text based browser game. I have been turned off by the idea because of the daunting amount of things to learn. PHP (or another sever side scripting language) Javascript HTML MySql And the fact of severs and apache.. Can I just pay for web hosting and by-pass having to set-up apache? Also ho...

How to create several records in only one dynamic form?

Hi experts, please help me with a simple PHP doubt. I have a simple form: < form action="foo" > < label >Person:< /label > < input type="text" id="name" > < input type="text" id="last_name" > < a href="javascript:addmore();">Add More < /form > Every time the user clicks Add More two new input fields will be dynamically created ...

PHP - file uploads and ways to prevent viruses from being uploaded in zip/rar archives

I am trying to provide a service on my website to allow users to upload files so others can download them. The issue is, since some of these files I will allow to upload will be .zip/.rar files, I am curious as to what ideas exist to help prevent the uploading of archives with Viruses/trojans etc. included. Some .zip files will include ...

Can php query the results from a previous query?

In some languages (ColdFusion comes to mind), you can run a query on the result set from a previous query. Is it possible to do something like that in php (with MySQL as the database)? I sort of want to do: $rs1 = do_query( "SELECT * FROM animals WHERE type = 'fish'" ); $rs2 = do_query( "SELECT * FROM rs1 WHERE name = 'trout'" ); ...