php

PHP Xpath following-siblings

I'm trying to use xpath to get the contents of a table. The table looks like this <div> <table> <tr class="tableheader"> <td> Stuff </td> </tr> <tr class="indent1"> <td> Contents </td> </tr> <tr class="indent1"> <td> Contents </td> </tr> <tr class="tableheader"> <td> Stuff </td> </tr> <tr class="indent1"> <td> C...

String contains any items in an array (case insensitive)

How can i check if a $string contains any of the items expressed in an array? $string = 'My nAmE is Tom.'; $array = array("name","tom"); if(contains($string,$array)) { // do something to say it contains } Any ideas? ...

How to tell curl to use clients ip not the servers?

hi, i am using curl to get some info from a website, however it uses the server ip address but i want it to use the client ip address, so each user send request with their own ip not the servers, how is that possible? $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "URL"); curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURL...

phpmailer with hotmail?

I'm trying to send emails from my server by a PHP script. I used to send it by a native php function mail and everything worked OK. Here's the code I used: $to = $sMail;<br> $subject = $sSubject;<br> $message = $sMessage; $headers = 'From: [email protected]' . "\r\n";<br> $headers .= 'Reply-To: [email protected]' . "\r\n";<br> $headers ....

Collecting Recurring Payments with Paypal

I have been reading alot documentation surrounding recurring payments and paypal. It can be frustrating at times to setup paypal especially when you are not told of the requirements and restrictions that apply to the paypal service you are trying to setup. I wanted to setup recurring payments because I would like to provide options for m...

PHP Kohana CentOS 5

Trying to deploy a Kohana based project in CentOS 5. Installed PHP 5.3.1 but still getting the following error. Warning: preg_match() [function.preg-match]: Compilation failed: this version of PCRE is not compiled with PCRE_UTF8 support at offset 0 in /usr/local/apache2/htdocs/icarus/system/core/utf8.php on line 30 Fatal error: PCRE ha...

Will a Registry Class in PHP work like this?

If I create a registry object to store other objects and settings in like this... $registry = Registry::getInstance(); And then create 2 other objects and pass the Registry object into them like this below... $core = new core($registry); $database = Database::getInstance($registry); and then later in the script I add some obje...

preg_replace taking out an extra string

I have a preg_replace taking out a part of a string it shouldn't be removing. It should be looking for: images_client/39/structure/party-2/ And replacing it with: images_client/39/structure/xxx/ It does do that, but it's also removing the images/ part of it just before apple_logo.jpg <?php echo '<br>-------- preg_replace on a css...

CakePHP Auth retrieve extra data

I am just learning CakePHP, so excuse me I am using CakePHP 1.2.5 Auth component with UsersController. User model contains two tables: class User extends AppModel { var $name = 'User'; var $belongsTo = 'Company'; } When login() is called, I see the data being retrieved in the SQL log (LEFT JOIN is being executed), so the mod...

Text file lines into array with PHP

How would I put the lines of a text file into an array with PHP? Thanks. ...

Setting up Cpanel RVKin Theme

Hi, I am having some problems with setting up the RVskin. I have reseller account running WHMCS. I inputed and approved a few test orders for a test webhost package. The account was created in whmcs but not whm.i.e. the cpanel account was not created. The activity log had this: "Error: Unable to validate setting for cpmod: RVSkin. ". Ple...

mutiple database in codeigniter

Hi ..., I'm trying to implement mutiple database in CI. My code Is here: //database.php $active_group = "default"; $active_record = TRUE; $db['default']['hostname'] = "localhost"; $db['default']['username'] = "root"; $db['default']['password'] = "root"; $db['default']['database'] = "ravelex"; $db['default']['dbdriver'] = "mysql"; $db['...

How can I access the contents of this PHP array?

Below are the files in PHP that I am trying to include a file that holds an array into my class and then access the array. if I run print_r() on it I get results but if I try to access the array item individually I get nothing, can anyone help me please? <?php // config.class.php /* example usages $config = Config::getInstance(PATH_TO_...

How to apply normalization on mysql using php

Please I don't have any idea. Although I've made some readings on the topic. All I know is it is used to make the data in the database more efficient and easy to handle. And It can also be used to save disk space. And lastly, if you used normalization. You will have to generate more tables. Now I have a lot of questions to ask. First,...

Does naming your form fields the same as mysql actually pose any security risk?

Is there any reason why you should or shouldn't name your form fields exactly the same as the HTML fields? <input type="text" name="my_field_1" id="my_field_1" /> --> mysql row my_field_1 or <input type="text" name="myField1" id="myField1" /> --> mysql row my_field_1 The only thing I can think of are probably naming conventions for...

Accessing sequence created in oracle database from php script.

I have created sequence in database like, CREATE SEQUENCE seq INCREMENT BY 1; How can i assign the current value of seq in $t; <?php $t=?; ?> ...

PHP: Facebook stream.publish and outdated template bundles?

Ok So I haven't tried messing with the facebook PHP API for months.. it's gross. Since template bundles are apparently now defunct, how can I publish a story into my users news feed for their friends? I've also already requested permissions. Edit: The issue seems to arise from requested permissions not being set for the user when They ar...

login form in php

how to make a login form in php. I just need to validate a user stored in the database. Please, I don't have any idea on how to make it. ...

getElementById().value returns nothing

<td id="'.$row['id'].'"style="display: none;"> <input id="addEdit" type="text" value="" size="4"/> </td> <td> <input name="add" value="A" type="submit" onClick="addObs('.$row['id'].'); return false;"/> </td> . function addObs(id) { var addEditTD = document.getElementById(id); if (addEditTD != null && addEditTD.style.d...

simple encryption technique for mysql using php

How to encrypt user password in php. please explain in a way a beginner can understand. I already have this sample code: $password="john856"; $encrypt_password=md5($password); echo $encrypt_password; Can you help me incorporate it in my current code, which does not do any encryption. <?php $con = mysql_connect("localhost","root...