php

delete confirmation in php viewing the entry to be deleted

I have a delete form wherein the user will enter the pnum to be deleted and then it will delete the corresponding record. But I want the user to atleast see what would be deleted so I tried this code, but it doesnt seem to work: <?php $con = mysql_connect("localhost","root","nitoryolai123$%^"); if (!$con) { die('Could not conne...

building effective mysql ajax search

i am currently working on a search engine for a small database but feel as if my approach to building it has been a bit bloated so far. does anyone have any suggestions on how i could streamline the ajax code? here is my ajax.php file.... <p><a href="#clients" class="form">Clients</a> &nbsp; <a href="#files" class="form">Files</a> &nbsp...

PHP - Add to Array

How do I add to the end of each sub array? Here is an example. $products = array( array( Code => 'TIR', Description => 'Tires', Price => 100 ), array( Code => 'OIL', Description => 'Oil', Price => 10 ), array( Code => 'SPK', Description => 'Spark Plugs', Price =>4 ) ); I want to add SKU=>1234 after Price ...

Symfony user authentication using Active Directory

Is there a way to authenticate users in symfony apps using Active Directory? Can you please point out some documentation? edit What i need is to have a transparent login in my application. The user authenticates once at windows logon, then all applications should be accessed with the same credentials without being asked for the domain\...

Is it possible to perssist an SMTP connection using PEAR after php finishes it's execution?

As I see, pear only persist the connection during the execution of the script, then it releases... ...

Security in your own application

Hi, My app is running on domain example.com, but I fetch some data from domain api.example.com. Example: User want to add new article. example.com send request to api.example.com/add Question: I would like to know, which security should I use to verify user? oAuth? Or should I send user's password over POST? Thank you. ...

How to check file encoding in Linux? Handling multilingual scripts.

Hello Guys, My company has php scripts with texts in different languages (including french, german, spanish, italian and english). Developers decided to use Latin-1 encoding as base for everyone, so this way nobody will override file encoding and corrupt foreign languages in it. (At first some developers used html entities, but this w...

How do I add another checkbox to the php in my contact form?

Hi I'm trying to add some another field to this php contact form I have a checkbox for "do you agree to our terms of business", but how do I add another one for opt in for Marketing. Thanks for your help Regards Judi <?php $adminemail = '[email protected]'; // type your actual email address in place of [email protected] $usese...

Google Adwords Reporting With Dynamic PHP Conversion Value

I am using Google Adwords to push and track subscriber acquisitions on my site, but can not get the conversion reporting to work. Here is my setup. My subscribe form is dynamically loaded on my subscribe page by a Wordpress plugin I created. After validation the form is replaced with a thank you message with php, so the user is not r...

PHPUnit Mock Objects and Static Methods

I am looking for the best way to go about testing the following static method (specifically using a Doctrine Model): class Model_User extends Doctrine_Record { public static function create($userData) { $newUser = new self(); $newUser->fromArray($userData); $newUser->save(); } } Ideally, I would use...

how to scan image on php or javascript?

hello all i dont know its possible or no? i have a project in php , can we scan image on php or javascript or ... via scanner , is any way for that? ...

safe url with .htaccess and moderewrite

hi guy its my first time here and my english sukcs, sorry... i have a problem with my .htaccess, i'm trying to redirect a page with a safe url using this code: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^noticias/pagina/([0-9]+)/?$ news.php?id=$1 [NC,L] but my swf files called...

How do you create subdomains using PHP? Is is possible on shared hosting?

I'm interested to create subdomains on the fly directly from php. For example when an user create a new page I want that page to be newpage.mydomain.com. Is that possible without changing the php or apache configuration files (supposing I'm using a shared hosting account). Later Edit: I'm talking about my domain, and I have full access ...

imported database dump from latin1 db to utf8 database

I used iconv to convert from latin1 to utf8 when I did an mysql dump of a database from mysql v4.0.21, and imported it onto a new server mysql v5.0.45 It was latin1 on the old server, it’s utf8 on the new server, so I ran this on the mysql dump: iconv −f latin1 −t UTF−8 quickwebcms_2010-03-01.sql It ran successful, then I imported it o...

mod_geoip2 and php pecl-geoip: how can i query by ip address?

Hiya. how can i query the geoip database using php? I have apache2 with mod_geoip2 installed and the pecl extension geoip PHP 5.3. i want to search the country of the ip address i have as a parameter, not to query my own ip address. thanks ...

"Should I use multiple indices in Solr?", and some other quick Q

Imagine a classifieds website, a very simple one where users don't have login details. I have this currently with MySql as a db. The db has several tables, because of the categories, but one main table for the classified itself. Total of 7 tables in my case. I want to use only Solr as a "db" because some people on SO thinks it would be...

What are the advantages of using JSP? (java sever pages)

What are the advantages of using jsp over PHP or Ruby on rails? Thanks in advance;-) ...

how to set a variable for external javascript file?

I am trying to figure out how to set my session_id variable to to be used in an external js file. Here is what I have. php file: $output = '<script src="test.js"> var session_id = '.$_SESSION['id'].' </script>'; print $output; js file: alert(session_id); With this I am getting an error saying session_id is not defined. Is the...

Copy a Doctrine object with all relations

I want to copy a record with all his relations. I'm trying with: $o = Doctrine::getTable('Table')->Find(x); $copy = $object->copy(); $relations = $o->getRelations(); foreach ($relations as $name => $relation) { $copy->$relation = $object->$relation->copy(); } $copy->save(); This code doesn't works, but I think it's on the way. ...

Dealing with eacute and other special characters using Oracle, PHP and Oci8

Hi I am trying to store names into an Oracle database and fetch them back using PHP and oci8. However, if I insert the é directly into the Oracle database and use oci8 to fetch it back I just receive an e Do I have to encode all special characters (including é) into html entities (ie: &eacute;) before inserting into database ... or am ...