
reksss
Members-
Posts
17 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
reksss's Achievements

Newbie (1/5)
0
Reputation
-
Do anybody know how to write PHP script for connecting Perforce?
reksss replied to reksss's topic in PHP Coding Help
Hey i missed to tell something. If u do any changes in the browser, the file need to call, edit and submit automatically in the perforce... -
Do anybody know how to write PHP script for connecting Perforce?
reksss replied to reksss's topic in PHP Coding Help
Hello, I checked the link which has mentioned above. I was totally different while comparing with my coding... Will u help me to fix the bug? Thanks -
Do anybody know how to write PHP script for connecting Perforce?
reksss replied to reksss's topic in PHP Coding Help
Hello.... If i run this program i got the below error msg. Run -> edit successfully [P4.run()] Errors during command execution( "p4 submit -r" ) [Error]: No files to submit from the default changelist. Error: No files to submit from the default changelist. <?php $p4 = new P4(); $input_file = "//Consumer/WSE/Dev/SSO-1.0/SSO/QA/edit.txt"; //*********** Connect to Perforce ************************************* $p4->port = "tw-p4proxy.tw.trendnet.org:1667"; $p4->user = "***"; $p4->client = "WSE_QA_tw-rekha"; $template = "WSE_QA_tw-rekha"; $client_root = "C:/Users/rekha_sokiyan/WSE_QA_tw-rekha"; $client_name = "WSE_QA_tw-rekha"; $p4->connect(); $p4->run_login('******' ); try { //*************** SYNC ******************************************** $p4->exception_level = 1; // Convert client spec into an array $client = $p4->fetch_client("-t", $template); $client['Root'] = $client_root; //print_r($client); $p4->save_client($client); // File(s) up-to-date is a warning; no exception raised if($p4->run_sync($input_file)) echo "\nRun -> sync successfully\n"; //**************** EDIT ******************************************** if($p4->run("edit",$input_file)) echo "\nRun -> edit successfully\n"; $p4->client; //*************** SUBMIT ******************************************* $change = $p4->fetch_change(); // Files were opened elsewhere and we want to submit a subset that we already know about. $myfiles = array( '//Consumer/WSE/Dev/SSO-1.0/SSO/QA/edit.txt', '//Consumer/WSE/Dev/SSO-1.0/SSO/QA/test.txt' ); $change['Files'] = $myfiles; $p4->input = $change; $p4->change = $change; $change['Description'] = "My changelist\nSubmitted from P4PHP\n"; //print_r($change); $p4->run_submit("-r",$change); $spec = $p4->fetch_change(); $spec["Description"] = "My changelist\nSubmitted from P4PHP\n"; //$p4->run_submit($spec); //print_r($spec); //if($p4->run_submit("-i",$change)) // echo "\nRun -> Submitted from P4PHP\n"; //**************** EDIT ******************************************** if($p4->run("edit",$input_file)) echo "\nRun -> edit successfully\n"; $p4->client; //*************** SUBMIT ******************************************* $change = $p4->fetch_change(); // Files were opened elsewhere and we want to submit a subset that we already know about. $myfiles = array( '//Consumer/WSE/Dev/SSO-1.0/SSO/QA/edit.txt', '//Consumer/WSE/Dev/SSO-1.0/SSO/QA/test.txt' ); $change['Files'] = $myfiles; $p4->input = $change; $p4->change = $change; $change['Description'] = "My changelist\nSubmitted from P4PHP\n"; //print_r($change); $p4->run_submit("-r",$change); }catch (P4_Exception $e) { print $e->getMessage() . "\n"; foreach ($p4->errors as $error) { print "Error: $error\n"; } } ?> [code] Do anybody help me to fix it? -
Hello friends, I have a problem. I want to open excel file and get the datas from the specific sheet and get N39 data. Do u have any idea? Waiting for ur reply... bye
-
[] - This is the Character class. U must need to specify all conditions by using []. [a-zA-Z0-9._-] It means ur allowing any lowercase[a-z], uppercase[A-Z], any numbers[0-9], special characters[._-].
-
Hello Friends.... I want to send mail by using PHP. I have downloaded PHPMailer for PHP5/6 from the below website. http://phpmailer.worxware.com/index.php?pg=examplebgmail I included path in my php.ini file. If i run my program, i got some errors... <?php require("phpmailer.inc.php"); $mail = new phpmailer; $mail->IsSMTP(); // set mailer to use SMTP $mail->From = "[email protected]"; $mail->FromName = "Yahoo"; $mail->Host = "smtp1.site.com;smtp2.site.com"; // specify main and backup server $mail->AddAddress("[email protected]", "Rekha"); $mail->AddAddress("[email protected]"); // name is optional $mail->AddReplyTo("[email protected]", "Information"); $mail->WordWrap = 50; // set word wrap $mail->AddAttachment("README"); // add attachments $mail->AddAttachment("manual.html"); $mail->IsHTML(true); // set email format to HTML $mail->Subject = "Mail sending by using PHP"; $mail->Body = "ABCDEFGHIJKLMNOPQRSTUVWXYZ.abcdefghijklmnopqrstuvwxyz"; $mail->Send(); // send message ?> I got the following errors PHP Notice: Undefined variable: from in /home/rose/public_html/BBSC/phpmailer-0.9/phpmailer/phpmailer.inc.php on line 259 PHP Notice: Undefined variable: Encoding in /home/rose/public_html/BBSC/phpmailer-0.9/phpmailer/phpmailer.inc.php on line 271 PHP Fatal error: Cannot access empty property in /home/rose/public_html/BBSC/phpmailer-0.9/phpmailer/phpmailer.inc.php on line 271 I am seeking for ur help friends.... Its urgent....
-
Hello... I want to draw a nodes with arcs by using PHP. Is there any package available to do this? My nodes values are gene name. Please help me.........
-
Dear Friends.... Thanks for your reply. Actually i will get input from client and i need to search in mysql and display the result as HTML table. in db the column color has values like listed below red|blue|green blue yellow|orange blue|yellow red yellow light green dark green light yellow violet If the user will key input like 're,blue' (or) 'red,blue' i need to listed the output like red|blue|green blue blue|yellow red Sometimes the user may give more input like 10 or 15 colors. If so, how will get all the input. Actually im doing same like for gene_id column. Their the column datatype is integer and the user will give the correct number. So 'IN operator is working well'. But for colors if the user will key input like "yel" for yellow, i need to search for yellow and need to print. I find '%' sign is not working in the 'IN' operator. For matching one data, 'LIKE' is ok. But if search for 10 or 15 datas, then how should i do? I must need to write query like this select * from table_color where (color LIKE 'red') AND (color LIKE 'yell') AND (color LIKE 'brown') AND (color LIKE 'bro') AND (color LIKE 'yellow') AND (color LIKE 'n') Is there any other way to do this? Some times the user may input like 20 to 30 data's means how will we do?
-
Hello Friends.... I want to compare two or more strings by using Mysql select statement. Suppose for example i need to check "red","green","blue" values from the Mysql column 'color' and need to display all values I tried select * from table_colors where color IN ('green','blue','red'); I think IN operator will work only for integer. Do any one know which operator may i use for getting the ouput....
-
How to create a text file while runnning PHP program from browser?
reksss replied to reksss's topic in PHP Coding Help
Hi Ken.... I used ls -l for checking the file permission in Linux. I found for user it doesnt has W permission. So i used chmod. chmod -R 777 * ls -l Now it is working well............ Thanks u friends for ur help.............. -
How to create a text file while runnning PHP program from browser?
reksss replied to reksss's topic in PHP Coding Help
I changed the file permission chown -R rekha /home/rekha/public_html/Webpage chmod 755 /home.rekha/public_html/Webpage. But still its not working!!! -
How to create a text file while runnning PHP program from browser?
reksss replied to reksss's topic in PHP Coding Help
I corrected it. While clicking the Submit button im getting error "Could not open sample.txt file"'. I heard from one of my friend that if we run from browser, we cant able to write data in the file. I tried a simple program. <?php //OPENING the input FILE //********************** $fp = @fopen("sample.txt",'w') or die("Could not open sample.txt file"); fwrite($fp,"Testing\n"); fclose($fp); ?> <HTML> File open testing </HTML> It is running well in putty but not from IE. Plz help me..... -
How to create a text file while runnning PHP program from browser?
reksss replied to reksss's topic in PHP Coding Help
Hello.... I first want to thank u for your reply. I am trying to run the program from IE. Below i have listed the code. U can see the fopen() and fwrite() in getDataFromDB() function. Waiting for your reply. <?php if($_GET["gene"]) { $select_species_human = $_GET['Human']; $select_species_mouse = $_GET['Mouse']; $genesymbol = $_GET['genesymbol']; $gene = $_GET['gene']; $submit_button = $_GET['submit']; connectDatabase(); //echo "$select_species_human\t$select_species_mouse\n"; //SET THE TAX_ID //************** if(strlen($select_species_human)!=0) $tax_id = "9606"; elseif(strlen($select_species_mouse)!=0) $tax_id = "10090"; else echo("<SCRIPT LANGUAGE='JavaScript'> window.alert('Choose a Species') </SCRIPT>"); if($genesymbol=="genesymbol") { $value = "genesymbol"; } elseif($genesymbol=="geneid") { $value = "geneid"; //getDataFromDB($tax_id,$value,$gene); } } ?> <!------------------------------------------------------------------------------------------------------------------> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Bioinformatics Biology Service Core</title> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <div id="header"> <br><br><center> <h2>Bioinformatics Biology Service Core</h2> <h3>Institute of Molecular Biology</h3> </center> </div> <!------------------------------------------------------------------------------------------------------------------> <div id="container-top"></div> <div id="container"> <div id="left"> <div id="left-top"></div> <!------------------------------------------------------------------------------------------------------------------> <div id="left-centre"> <h2>Select a Species</h2> <form method="GET" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <ul class="menu"> <li><input type="checkbox" name="Human" value="human">Human</li> <li><input type="checkbox" name="Mouse" value="mouse">Mouse</li> </ul> <h2>Input details</h2> <p> <input type="checkbox" name="genesymbol" value="geneid"> GeneID <input type="checkbox" name="genesymbol" value="genesymbol">Gene Symbol</p> Enter Gene ID (or) Name <input type="text" name="gene"/> <br /> <input type="submit" value="Submit" name ="submit"> </form> </div> <div id="left-bottom"></div> </div> <!------------------------------------------------------------------------------------------------------------------> <div id="right"> <div id="tabs"> <ul> <li><div class="tab-active"><a href="#"><span>main</span></a></div></li> <li><div class="tab"><a href="#"><span>latest news</span></a></div></li> <li><div class="tab"><a href="#"><span>about</span></a></div></li> <li><div class="tab"><a href="#"><span>contact us</span></a></div></li> </ul> </div> <div id="right-top"></div> <div id="right-centre"> <h1>Main page</h1> <p> <!-- <a href="http://192.168.100.152/~rekha/Webpage/result.xls"> SAVE </a> --> <?php connectDatabase(); getDataFromDB($tax_id,$value,$gene); ?> </div> <div id="right-bottom"></div> </div> <div class="clear"></div> </div> <!------------------------------------------------------------------------------------------------------------------> <div id="container-bottom"></div> <!------------------------------------------------------------------------------------------------------------------> <div id="footer-top"></div> <!------------------------------------------------------------------------------------------------------------------> <div id="footer-centre"> <p>© 2007 Your Name Here<br /> <a href="http://gregdev.net">Bioinformatics Biology Service Core</a></p> </div> <!------------------------------------------------------------------------------------------------------------------> <div id="footer-bottom"></div> </body> </html> <!------------------------------------------------------------------------------------------------------------------> <?php function myfunction($v1,$v2) { return $v1 .",". $v2; } //************************************************************************************************* function getDataFromDB($tax_id,$value,$gene) { //CODINGS FOR "GENE ID" //********************* if($value == "geneid") { $total_gene_id = explode(",",$gene); $size_of_total_gene = sizeof($total_gene_id); $result_gene_id = (array_reduce($total_gene_id,"myfunction")); $extract_gene_id_list = substr($result_gene_id,1); //echo $extract_gene_id_list; $query = "SELECT * FROM gene2go WHERE (tax_id = '$tax_id') AND (GeneID IN ($extract_gene_id_list))"; } //CODINGS FOR "GENE SYMBOL" //************************* else if($value == "genesymbol") { $total_gene_symbol = explode(",",$gene); $size_of_total_gene_symbol = sizeof($total_symbol); $result_gene_symbol = (array_reduce($total_gene_symbol,"myfunction")); $extract_gene_name_list = substr($result_gene_symbol,1); $query = "SELECT a.* FROM gene2go a,`gene_info` b WHERE b.`tax_id` =10090 AND (b.Symbol IN('$extract_gene_name_list') OR b.Synonyms IN ('%$extract_gene_name_list%'))AND (b.GeneID = a.GeneID)"; echo $query; } else { echo "\nError in choosing the Gene Id or Symbol\n"; } $result = mysql_query($query) or die('Error, query failed'.mysql_error()); $fp = @fopen("sample.txt",'w') or die("Could not open sample.txt file"); //echo "<a href='http://192.168.100.152/~rekha/Webpage/result.xls'> SAVE </a>"; echo "<TABLE>"; echo "<TR>"; echo "<TH>TAX_ID</TH>"; echo "<TH>Gene_ID</TH>"; echo "<TH>Go_ID</TH>"; echo "<TH>Evidence</TH>"; echo "<TH>Qualifier</TH>"; echo "<TH>GO_Term</TH>"; echo "<TH>Pubmed</TH>"; echo "<TH>Catagory</TH>"; echo "</TR>"; while($row = mysql_fetch_array($result, MYSQL_BOTH)) { $tax_id = trim($row[0]); $gene_id = trim($row[1]); $go_id = trim($row[2]); $evidence = trim($row[3]); $qualifier = trim($row[4]); $go_term = trim($row[5]); $pebmed = trim($row[6]); $catagory = trim($row[7]); echo "<TR><TD>$tax_id</TD> <TD>$gene_id</TD><TD>$go_id</TD><TD>$evidence</TD><TD>$qualifier</TD><TD>$go_term</TD><TD>$pebmed</TD><TD>$catagory</TD></TR>"; fwrite($fp,"$tax_id."\t".$gene_id."\t".$go_id."\t".$evidence."\t".$qualifier."\t".$go_term."\t".$pebmed."\t".$catagory."\n"); } echo "</TABLE>"; //fclose($fp); } //************************************************************************************************* //CONNECTING WITH THE DATABASE //***************************** function connectDatabase() { mysql_connect("IPaddress","uname","password") or die("could not connected".mysql_error()); mysql_select_db("NCBI_gene_info") or die(mysql_error()); } ?> -
Hello Friends... I am creating a HTML webpage and connecting with MYSQL. If the client will check the conditions, it will pass it to PHP and get values from MYSQL and print it in the webpage as a HTML table format. Now i want to create a SAVE button and save the HTML TAble values as TXT tab demilited file. I tried of creating a TXT file by using fopen() and write the values by using fwrite() function. But it is working only in the putty. While running the program from the browser, its not working. Will somebody help me to solve this prob? I also was searched for creating a TXT file from HTML table. But i wouldnt get any codes reg this.... Thanks Rose