php

(php) how to generate a random, long salt for use in hashing?

what is a way in php to make a random, variable length salt for use in hashing. let's say i want to make a 16-character long salt - how would i do it? ...

php and mysql function not working

Im sorry if this post is long winded I have 2 php functions that that gets data from the database, the first one works fine but the second one doesnt seem to work and I cant find the cours. I hope somebody can find out, I have include the code for both functions and how I used them function data_to_maani_xml() { $i=0; $xml="<ch...

Is it possible to change Facebox's settings at runtime? How?

Is it possible to access Facebox settings? For example, I'd like to do set the location of the loading image dynamically (see line 4): <script type="text/javascript" src="<?php echo base_url(); ?>media/facebox/facebox.js" ></script> <script type="text/javascript"> $(document).ready(function(){ Facebox.loadingImage = '<?php echo...

PHP PDO search engine with relevancy

Hi, I'm desperately trying to create a relatively concise search engine with PHP, mySQL and PDO. I have a database of books, and I'm trying query a search against two of the fields. Here is what I have so far: "SELECT id, title, author, isbn, MATCH(title, isbn) AGAINST (:term) AS score FROM %sbooks WHERE MATCH(title, isbn) AGAINST (:te...

how to receive the post value of dynamic text box

hi this is my forloop which has bulk number of data $a = 1; for($i = 0; $i < sizeof($StudName); $i++) { ?> <tr align="left"> <td class="table_label"><? echo $code[$i].' - '.$StudName[$i]; ?></td> <td><input type="text" name="mark1<?= $a ?>" id="mark1<?= $a ?>" ></td> <td><input type="text" name="mark2<?= $a ?>" id="mark2...

Is it possible to allow access to an application using API

Is it possible to allow access for an api through API.? I dont want the user to manually Allow an application using Allow page?? Is this possible??? ...

RC4 encryption - CommonCrypto (Objective-C) vs PHP

Hi, I have a XML file on a server encrypted with the RC4 algorithm (http://rc4crypt.devhome.org) function encrypt ($pwd, $data, $ispwdHex = 0) { if ($ispwdHex) $pwd = @pack('H*', $pwd); // valid input, please! $key[] = ''; $box[] = ''; $cipher = ''; $pwd_length = strlen($pwd); ...

(PHP) How to correctly implement crypt()

Here is the example from the PHP manual page for crypt(): <?php $password = crypt('mypassword'); // let the salt be automatically generated /* You should pass the entire results of crypt() as the salt for comparing a password, to avoid problems when different hashing algorithms are used. (As it says above, standard DES-based pass...

E-mail validation in php? please help

Possible Duplicates: PHP email validation function Is there a php library for email address validation? I have a contact form on my site but i need a e-mail validation and i don't know how to do it. Please help ...

Illegal array-declaration in PHP ?

Why doesn't this validate with the W3C validator: 3 variables from form.html going into form.php: <?php $stuff1 = $_POST["stuff1"];//catch variables $stuff2 = $_POST["stuff2"]; $stuff3 = $_POST["stuff3"]; $myStuff[0] = $stuff1;//put into array $myStuff[1] = $stuff2; $myStuff[2] = $stuff3; ?> ...

Is there any "Else Case" in the switch function to use?

A switch statement consists of "cases"... But is there any "else" case for all other cases? Have never found the answer to this... ex: switch ($var){ case "x": do stuff; break; case "y": do stuff; break; else: // THIS IS WHAT I WOULD LIKE do stuff; break; } ...

Apache crashes when php_apc extension is turned on when using symfony?

It's happenning in windows. PHP5.3.0 Apache2.2.11 Symfony 1.4.1 Is there a fix ? [apc-error] Cannot redeclare class sfeventdispatcher in D:\wamp\symfony-1.4.1\lib\event_dispatcher\sfEventDispatcher.php on line 3. [crit] Parent: child process exited with status 2 -- Aborting. ...

(PHP) How to use crypt() with CRYPT_BLOWFISH?

First, I see that to use CRYPT_BLOWFISH, i need to use a 16 char salt starting with $2a$. However, the php.net documentation for crypt() says that some systems don't support CRYPT_BLOWFISH. How often is that the case? Next, from their example on the docs, I see I use crypt() as follows: <?php $password = crypt('mypassword'); // let the...

How to get A-Z and 0-9 from a string?

Hi! How do I get "Lrumipsm1" from "Lörum ipsäm 1!"? So what I need is to only get a-z and 0-9 from a string, using php. ...

About Googe map

Hello everyone I am PHP Developer and developing website .in that i used Google map with the facility of select state and city. for select state and city i put two drop down.so now my problem is when i select state then i can not get value of city and both time whenever use select state and city i refresh the page and so after refreshing...

How can I concatenate a constant and a variable and store it in a class constant with PHP?

class My_class { const STATUS_ERROR = 0; const STATUS_OK = 1; const DB_TABLE = TABLE_PREFIX . 'class_table'; } The two status consts work fine and can be accessed within class methods as self::STATUS_ERROR and self::STATUS_OK just fine. The issue is one of how to stop the following error being thrown when I try to define th...

Do you have to format the printout from print_r() in PHP to have it validate with W3C?

This will not validate because of the output from print_r, is it not supposed to be used "on a site" or do one have to format it in a certain way? <?php $stuff1 = $_POST["stuff1"];//catch variables $stuff2 = $_POST["stuff2"]; $stuff3 = $_POST["stuff3"]; $myStuff[0] = $stuff1;//put into array $myStuff[1] = $stuff2; ...

Searching for tutorials on writing PHP modules?

Possible Duplicate: Getting Started with PHP Extension-Development Has anyone got some resources on how to write PHP (> 5.2.x) modules in C/C++? Besides that would it be advisable to code such modules for efficiency gains on maybe sorting large heaps of search results and the like? Thanks in advance. ...

How to add onclick event to treeview in php(jquery plugin)?

Hello, I have realized a asynchronous treeview in php, now i want to add onclick event to the items in the treeview, and then make query in mysql. Do you know how to do that? Thanks a lot. Edit: Async.html: <script type="text/javascript"> $(document).ready(function(){ $("#black").treeview({ url: "twodimen.php" }...

JavaScript passing varibles between functions and processing them....

Hello, I'm working on a JavaScript based page that returns the cost of delivery, depending on what the user selects(Region, service(pre 12, etc) and weight). I have muddled my way through as I just dont know JS. My questions are: Can I pass the varible between functions - as detailed in the script below? Once the above has been achie...