s.prema@yahoo.com
Members-
Posts
26 -
Joined
-
Last visited
Never
Everything posted by s.prema@yahoo.com
-
Hello, Anybody there to help!!! I used the code to zip the excel file. It is zipped but got 'file corrupted' message opening the excel after extraction :'( <?php function uncompress($srcName, $dstName) { $string = implode("", gzfile($srcName)); $fp = fopen($dstName, "w"); fwrite($fp, $string, strlen($string)); fclose($fp); } function compress($srcName, $dstName) { $fp = fopen($srcName, "r"); $data = fread ($fp, filesize($srcName)); fclose($fp); $zp = gzopen($dstName, "w9"); gzwrite($zp, $data); gzclose($zp); } compress("a.xls","a.zip"); uncompress("a.zip","a1.xls"); ?> Help me! Or any library files are to be included?? Thanks. -Prema
-
Hello, I need to export mysql tables from php into xls All r working fine. But the field with the datatype 'date' is not exported properly. In xls cell it is displayed as ######## What went wrong?? Thanks in advance.
-
Hello, Here is my snippet, <script> function valid(name) { var t="<?php $_SESSION['FName']='<script>name</script>'; ?>"; } </script> <input name="chk" type="button" value="Submit" onclick="valid('Joe');" /> I need to store the variable 'name' in the php session variable 'FName'. Code is not exact or logical. But it could be similar. Struggling more. Need Help!!! Thanks.
-
Hello... I need to convert a jpeg image [image is a bar chart, generated thru php ] into a pdf file and send as an attachment in mails. Can php experts help to achieve this ?? Thank you.
-
Carrying values over pagination of same page
s.prema@yahoo.com replied to s.prema@yahoo.com's topic in Applications
Sorry a correction in my text.... For question 1 : Q1 holds Question id, radio button array holds the 3 options named OPT1[] For question 2 : Q2, OPT2[] For question 3 : Q3, OPT3[] and so on.. -
Hello everyone, I need to create a quiz module with db integration. User should select one of the three options each carry different points. Questions, options, points are stored in respective tables. Question count is dynamic and should be displayed with pagination [as link, to the same page quiz.php using mysql limit query], 5 questions per page. Now I am having up to 4 pages. And user can submit the quiz only in last page not before. Till this all done. Problem is, how to carry they selected answers over pages....???????? Please note, question id is dynamic and concatenated with the letter 'Q', and stored as hidden value, option id is also dynamic and concatenated with the word 'OPT', radio button array is used for every question. So, for every question, Q1 stores Question id, OPT[] holds the 3 options How to submit all these selected answers in the 4th page. Is it possible thru javascript.. or in PHP itself? :'( Very Urgent Thank U
-
Hello... I need to create two image base to display two independent bar charts in a single page. One I could, how to create another in same page like..... $img_width=800; $img_height=200; $img=imagecreatetruecolor($img_width,$img_height); this image is created on top left of the screen.. using $img i created a bar like, using imagefilledrectangle() on it now I need to create another image beneath the first one. Help Me!
-
Helllllllllo.............................. No one is there to answer?????????????
-
Hello My php page has, <input type="radio" name="group1" value="Milk"> Milk<br> <input type="radio" name="group1" value="Butter" checked> Butter<br> <input type="radio" name="group1" value="Cheese"> Cheese <hr> <input type="radio" name="group2" value="Water"> Water<br> <input type="radio" name="group2" value="Beer"> Beer<br> <input type="radio" name="group2" value="Wine" checked> Wine<br> The groups and the values are dynamic. While submitting the page, how can I get the total number of groups in the page ?? How to get the group count in print_r() ??? Thanks.
-
I need to develop a graphical / chart representation of a survey. User will input the answer for a set of questionnaire. Each question has 3 options, option A holds 5 points, B holds 2 points, whereas option C holds 0. After completing the questionnaire, according to options selected by user, pie chart or bar chart should be generated. Anybody did this before.. how to achieve this..?
-
Hello Actually I tried the following to export db and store the sql file in my source server, mysqldump -u admin -p instglive > /home/admin/public_html/test/storage/s.sql this is working fine. But now I need to import this sql file onto a remote server from my source server, what will be the command to work on putty???? In this following command where to mention the remote IP or remote path, mysql -h 222.22.22.22 -u dev -p instglive < /home/dev/public_html/test/instglive Its urgent. Thank u
-
Transferring file between FTPs
s.prema@yahoo.com replied to s.prema@yahoo.com's topic in Applications
Its working.. got solution. -
Hello I need to transfer a file from my ftp server to remote ftp server. Here is my code, but it gives error as, Warning: ftp_put() [function.ftp-put]: Can't open that file: No such file or directory <?php ob_start(); if(!file_exists('storage/glive.sql')) echo "File not found"; //ftp details of sedtination server $ftp_server="222.22.22.222"; $ftp_user="ferghco"; $ftp_password="*********"; $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, $ftp_user, $ftp_password); if((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $ftp_server for user $ftp_user"; exit(); } $upload = ftp_put($conn_id,'/test/glive1.sql', 'storage/glive.sql', FTP_BINARY); if (!$upload) { echo 'FTP upload failed!'; } ob_end_flush(); ?> Can anybody give the solution??????
-
Log Maintenance on MySQL affected tables in a log table
s.prema@yahoo.com replied to s.prema@yahoo.com's topic in MySQL Help
All ok... Understood. But php error in that 'for' statement... dont know how to correct..... how to insert linux for statement in php?? -
Log Maintenance on MySQL affected tables in a log table
s.prema@yahoo.com replied to s.prema@yahoo.com's topic in MySQL Help
Error occurring <?php #!/bin/bash $hostname='localhost'; $un= 'root'; $pwd=''; $db='test'; $link=mysql_connect($hostname, $un, $pwd); if(!$link) die('Could not connect: ' . mysql_error()); if(!mysql_select_db($db,$link)) die('Could not link db: ' . mysql_error()); $f='ttt'; $d='DESCRIPTION'; echo "DELIMITER ;;" >tmp.sql ; for f in "mysqlshow test | sed '1,4d;s/|//g;$d' | grep -v 'LOGGING'"; do echo "CREATE TRIGGER t_'$f' AFTER INSERT ON '$f' FOR EACH ROW BEGIN insert into LOGGING (table, username, logtime) values ('$f',CURRENT_USER(), NOW()); end ;; " >>tmp.sql ; done echo "DELIMITER ;" >>tmp.sql ?> can u explain the mysqlshow command.. $f holds the table name whereas $d ?? giving error as Parse error: syntax error, unexpected T_STRING, expecting '(' in C:\xampp\htdocs\xampp\Prema\trig.php on line 16 ie., in the command.. expalin pls... -
Elliminating repeating characters in a string??
s.prema@yahoo.com replied to s.prema@yahoo.com's topic in Applications
GOT Answer $string = "1122337749903"; $value = count_chars($string, 3); echo $value; //12374903 -
How to eliminate the repeating characters in a string... Say that , $str="12135142513"; I need the output only as. 12345 Very urgent. Thanks in advance
-
Log Maintenance on MySQL affected tables in a log table
s.prema@yahoo.com replied to s.prema@yahoo.com's topic in MySQL Help
Hmmm I knew intelligent people would find my posts on other forums easily Thank u But I m having having more than 100 tables............ -
Managing multiple PHP MySQL Connections
s.prema@yahoo.com replied to s.prema@yahoo.com's topic in MySQL Help
Here is my code: <?php #Staging $hostname='localhost'; $un= 'admin'; $pwd='******'; $db='instglive'; $link=mysql_connect($hostname, $un, $pwd); if(!$link) die('Could not connect: ' . mysql_error()); if(!mysql_select_db($db,$link)) die('Could not link db: ' . mysql_error()); #Live $hostname1='222.666.73.91'; $un1= 'test'; $pwd1='*******'; $db1='testdb'; $link1=mysql_connect($hostname1, $un1, $pwd1); if(!$link1) die('Could not connect: ' . mysql_error()); if(!mysql_select_db($db1,$link1)) die('Could not link db: ' . mysql_error()); $d="CREATE TABLE ".$db1.".".student." LIKE ".$db.".".student"; if(!mysql_query($d)) echo mysql_error(); ?> I need to work out the create table query on instglive db... anybody there to help???? -
Managing multiple PHP MySQL Connections
s.prema@yahoo.com replied to s.prema@yahoo.com's topic in MySQL Help
:'( Can anybody having solution to my problem...? How to create table on remote mysql server??????? -
Managing multiple PHP MySQL Connections
s.prema@yahoo.com replied to s.prema@yahoo.com's topic in MySQL Help
Thank u. But already Server A and Server B has lot of tables, only few are missing.. How to change them all now as federated.. ? Can u give the query to copy a table from Server A to B if it is federated..? -
Hello, I m trying to create a new table on server B as like a table on server A in php script. The steps I did are, 1. Using mysql_connect() and mysql_select_db() I established connection on Server A & B with 2 different variable sets, say variable $db1 holds the db of Server A and variable $db2 holds the db of Server B. 2. Tables are list from both the DBs 3. Needed to create missing tables on Server B [ie., copy missed tables with rows from server A to Server B]. Here, it is struggling................ How to create or copy a specific table from one server to another server or IP in PHP ??? Can anybody help?????? Its urgent. Thanks in advance.