php

help with php search

How would I do let the user know if there wasnt any rows found? And if it finds (for example) 26 rows I want it to print that it found 26 hits (Your search for "hey" gave 26 results) $name = mysql_real_escape_string($_POST['player_name']); $q = mysql_query("SELECT * FROM players WHERE name LIKE '%$name%'"); while ($row = mysql_fetch_a...

Wordpress Admin Section users.php

Hello, I'm hoping somebody knows the answer :). Within wordpress in the users section I would like to add a new row which will data pulled in from the Register Plus plugin. Where would I need to create a new row? My Example: Username Name E-mail Role **Website** Posts Admin Admin ...

Links in PHP help

Here is part of my my php code: while ( $row = mysql_fetch_array($result) ) { printf("PDB Code: %s<br> Protein Name: %s<br> RCSB URL: %s <br> JMOL View: %s <br> Ligand Code: %s<br> Ligand Formula: %s<br> Ligand Name: %s<br> Smile String: %s<br><br> ", $row[0], $row[1], <a href='urlencode($row[2])'>, $row[3], $row[4], $row[5],$row[6],...

What would be the best place to start learning AJAX (I have PHP as a backend)

hi friends, i am working in php as backend . i want to start learing ajax using mootools in php. if anyone have great start tutorial pl help and send me url. Thanks in Advance ...

How do I construct a cross database query in PHP?

In our last episode (How I constructed a cross database query in MySQL) I learned how to construct a cross database query in MySQL. This worked great but when our hero tried to use this newfound knowledge in PHP he found his best friend FAIL waiting for him. I took a look at mysql_select_db for PHP. This seems to imply that if I want to...

keep User Information in form in case of errors

How do i keep the information a user has entered in a form in a case where s/he has made an error in the form so that s/he does not have to make the entries once again? I would also like to indicate the errors made by highlighting the texboxes with the errors with a red color ...

Pass a php variable to mysql query

Hai guys, What is wrong in this code i get an empty array. i am passing a php variable to the query it didnt work, when i give a hardcoded value the query returns result. echo $sub1 = $examSubject[$i]; $subType = $examType[$i]; $query = $this->db->query("select dSubject_id from tbl_subject_details where dSubjectCode='$sub1'"); print_r(...

How to format a simple PHP array of strings?

I have this simple function which I pass in an array of strings: function myfunction( $arg = array() ) { // do stuff to $arg... // return a $string; } Simple so far, but I need some of the strings in the $arg array to be formatted, while some remain unformatted. I can't figure out how to do it? Say I run this $arg through myf...

Launch a process and get its return code or interrupt it if it lasts too long

Hello, I have a PHP script launched from a command-line (aka CLI mode, no webserver involved). In this script I launch a command that will run from some time, usually exiting after a couple minutes. But at times, this command will run for hours because of various issues, and the best I can do is kill it and wait for a while before laun...

Special characters in Flex

I am working on a Flex app that has a MySQL database. Data is retrieved from the DB using PHP then I am using AMFPHP to pass the data on to Flex The problem that I am having is that the data is being copied from Word documents which sometimes result in some of the more unusual characters are not displaying properly. For example, Word ...

Testing if a client certificat is installed in the client browser...

Hi, I was wondering if any of you know if it is possible in javascript or php to test if a client has a specific client certificate installed in the browser. The thing is that we have a server certificate installed but to be recognized by the clients, they need 2 client certificates that make them recognize the authority of the issuer ...

media conversion library

I am building a mobile website were users can upload/download videos and am looking for a library that can convert the media files from mpeg, 3gp, mov depending on what the user wants to download. thanks in advance. ...

Filter strings: and, or, minus to exclude

Do you know any solution for building string filters based on human input in PHP? E.g. foo and bar -zoo (like in search enginies) is converted to regex similar to this: .*(foo|bar).*^(zoo).*. I have found this class, but this is not exactly what I am looking for. ...

how to rescrict JS script being inserted in DB with php

Hi all, I have one problem regarding the data insertion in php. In my site there is a message system. so when my inbox loads it gives one javascript alert. I have search a lot in my site and finally i found that some one have send me message with below text. <script> alert(5) </script> So how can i restrict the script code bein...

Printing Query Results in a Table

Hello, If I had a MySQL table called "info" as described below and I wanted to print out an HTML table as described below, how would I do it? Fields in MySQL table: id subject category actions date status HTML table structure: Two columns, first containing the field "subject", next containing the field "actions," sorted by "actions...

If facebook connect user changes email will I be notified?

I am integrating facebook connect into my signup area of my site, I have a regualr signup which saves a user email and password in DB for signup and now there will be option to signup and login with facebook connect. I was planning on just adding the email hash that facebook sends to my login table for that user and in there roadmap, th...

Spreadsheet_Excel_Writer making Rows width longer

How can i make rows a bid longer? if i output the excel all prints fine, only if the title is a bit long, then the Title is not readable. How can i fix that? ...

DOMDocument::load in PHP 5

Hello all, I open a 10MB+ XML file several times in my script in different functions: $dom = DOMDocument::load( $file ) or die('couldnt open'); 1) Is the above the old style of loading a document? I am using PHP 5. Oppening it statically? 2) Do I need to close the loading of the XML file, if possible? I suspect its caus...

problems posting twice to same page using PHP_SELF... is this possible?

hey everyone, im having a problem with php yet again... i've created a page with multiple forms on it and when i test it i've learnt that the first form is processed (with the ongoing, complete and reject) values but then i cant seem to process the 2nd form the same way. what could be the matter? any help would be appreciated... happy ...

Automating Products (with details) Addition

Assume a simple order processing system. A Category is selected, which lists range of products, and when a product is selected, it allows for details about that product to be entered. The details differ for each product. The admin user wants enable adding new products to this system, without the programmer getting involved. The cha...