Jump to content

mrjameer

Members
  • Posts

    102
  • Joined

  • Last visited

    Never

Everything posted by mrjameer

  1. hi, i have a table.in that there are nearly 12000 email ids.in that may be 1000 email ids duplicates(repeated twice).i want to transfer the unique email ids from old table to new table.i tried the code but it is transfering the all ids but not unique.how to solve this.any of your help will be appreciated.here is my code <?php $conn4=mysql_connect("localhost","",""); mysql_select_db("mrj",$conn4); $sql="INSERT INTO cc (email) SELECT DISTINCT email FROM bb"; $result=mysql_query($sql,$conn4) or die(mysql_error()); if($result) { echo "transfered"; } else { echo "not"; } ?> thanks mrjameer
  2. hi, i tried some code.the following code is used to display records from mysql table and dynamically creates a checkbox for every record. when i click checkbox and press submit button,that particular record will be hided(unpublished),here the field 'published' value will be set to '0' means unpublished and '1' for published.upto this ok. but what i want to do is when i want publish the same record again,how to code.if i create another button,how to make it in action.i want to code like this. if published value='0' then if i click checkbox and press submit button,the published value='1'.if published value='1' then if i click checkbox and press submit button,the published value='0'.any of your help will be surely appreciated. thanks mrjameer <?php mysql_connect("localhost", "", "")or die("cannot connect"); mysql_select_db("mrj")or die("cannot select DB"); $sql="SELECT * FROM ahost"; $result=mysql_query($sql); $count=mysql_num_rows($result); ?> <center><table width="400" border="0" cellspacing="1" cellpadding="0"> <tr> <td><font color="navy"><form name="form1" method="post" action=""><br><center><b> <table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td bgcolor="lightgreen" align="center"><font color="navy">#</font></td> <td bgcolor="lightgreen" align="center"><font color="navy"><strong>Id</strong></font></td> <td bgcolor="lightgreen" align="center"><font color="navy"><strong>details</strong></font></td> <td bgcolor="lightgreen" align="center"><font color="navy"><strong>bandwidth</strong></font></td> <td bgcolor="lightgreen" align="center"><font color="navy"><strong>email_accounts</strong></font></td> <td bgcolor="lightgreen" align="center"><font color="navy"><strong>published</strong></font></td> </tr> <?php while($rows=mysql_fetch_array($result)){ ?> <font color="navy"> <tr class="odd" onmouseover="over(this);" onmouseout="out(this);"> <td align="center"><font color="navy"><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<? echo $rows['id']; ?>"></font></td> <td><font color="navy"><? echo $rows['id']; ?></font></td> <td><font color="navy"><? echo $rows['details']; ?></font></td> <td><font color="navy"><? echo $rows['bandwidth']; ?></font></td> <td><font color="navy"><? echo $rows['email_accounts']; ?></font></td> <td><font color="navy"><? echo $rows['published']; ?></font></td> </tr></font> <?php } ?> <tr> <td colspan="5" align="center" ><input name="delete" type="submit" id="delete" value="unpublish"> </font></td> </tr></table></center> <?php if($delete) { for($i=0;$i<$count;$i++){ $del_id = $checkbox[$i]; $sql = "UPDATE ahost SET published='0' WHERE id='$del_id'"; $result = mysql_query($sql); } if($result){ echo "<meta http-equiv=\"refresh\" content=\"0;URL=viewfiles1.php\">"; } } mysql_close(); ?> </table> </form> </font></td> </tr> </table></center>
  3. hi, i have a mysql table called footers.it's fields are as follows id--caption--content 1--aboutus--some company info 2--privacy--privacy info 3--copyright--copyright info here i retrieved all the captions from table and print in the footer position on my form as footer menu.what i want to do actually is when i click aboutus,it should open small window and display the aboutus content from mysql table,similarly when i click privacy,it should open a small window and should display privacy info like that.everything i did,but when i click aboutus,it shows all the three records from table.i want to display uniquely.means if i click aboutus it should display only aboutus info in small window like that..any of your help will be greatly appreciated here is my code <?php $conn4=mysql_connect("localhost","",""); mysql_select_db("jrm",$conn4); $sql="SELECT * FROM footers"; $result=mysql_query($sql,$conn4) or die (mysql_error()); echo "<center><table border='0' style='text-align:left;'><tr>"; while($newarray=mysql_fetch_array($result)) { $caption=$newarray['caption']; echo "<center><a style='text-decoration:underline;' href onclick=window.open('xyz.php','','top=200,left=350,screenY=0,screenX=0,width=400,height=300,scrollbars=yes');> <td><font color='white'><b>".$caption. "&nbsp;&nbsp;</b></font></td></a></center>"; } echo "</tr></table></center>"; ?> xyz.php ------ <?php $conn4=mysql_connect("localhost","",""); mysql_select_db("jrm",$conn4); $sql="SELECT * FROM footers"; $result=mysql_query($sql,$conn4) or die (mysql_error()); while($newarray=mysql_fetch_array($result)) { $caption=$newarray['caption']; $content=$newarray['content']; echo "<center><b><u><font color='navy'>".$caption."</font></b></u><br><font color='green'>".$content."</font></center>"; } ?> is it possible without using xyz.php file,i will display the $content in small window directly thanks mrjameer
  4. hi, i have a mysql table which contains some hosting plans info.there are 5 records inside the table.what i want to do is i want to put button like publish/unpublish for every record.so that whenever i dont want to publish a particular record i will simply click unpublish.is it posible to do this with php.any of your help will be greatly appreciated. thanks mrjameer
  5. hi, i want to retrieve all images which are present in mysql table.i want to display 5 images per row.but when i fetch image it shows one image only.here is my code.how to solve this problem.any of your help will be appreciated <?php $conn4=mysql_connect("localhost","",""); mysql_select_db("jo",$conn4); $sql  = "SELECT name, type, size, content FROM image_upload";     $result  = mysql_query($sql,$conn4) or die(mysql_error()); list($name, $type, $size, $content) = mysql_fetch_array($result);   header("Content-Disposition: attachment; filename=$name");     header("Content-length: $size");     header("Content-type: $type");     echo $content; ?> thanks mrjameer
  6. hi, i want to fetch all records from mysql table and print every record as html table using php.but when i fetch the records,it will displays as one table only. but i want to display one record as one table. i dont need to print field names. please any of your help will be appreciated. thanks mrjameer
  7. hi, i have one mysql table called employee.its fields are as follows id--name 1--abc 2---cbv 3--edr .i want to display the all names from db in html marquee.when i try to print all values it prints only last value in marquee.how to do this.any of your help will be appreciated thanks mrjameer
  8. hi, i have a table.it's structure is like this itemno--itemname--price 1--abc--200 2--djh--300 3--eee-400 i want to dynamically create 3 radio buttons for prices and to display these records on web page and when a user click radio button of any one the selected values should be stored in some other table.how to do this.i know how to display and store in db.problem is with dynamically creating radio buttons.please any of your help is appreciated. thanks mrjameer
  9. hi, iam making a website for school.on one web page,there are 2 radio buttons.1 is for science and one for computers.like this subjects 1.science 2.computers the user can click any of radiobutton and press submit button it will moves to the second web page.on that again i have 2 radiobuttons.1 for sing and one for music like this. hobbies 1.sing 2.music. here he clicks one radiobutton and press the submit button,then his choosen subject and hobbies should be stored in mysql table.i did all this.but here what i actually want to do is,if he selects only subject and ignore the hobbies then the subject should be stored in db.if ignore the subject and chooses the hobbies only then it should be stored in db.i used sessions to move data from one page to another. i dont know how to do this.please any of your help is appreciated. thanks mrjameer
  10. hi, iam using the following mail function. code is.. mail($new_email, _new_subject,_new_mobile."$new_mobile", _new_conftext."\n\n$buildlink", "From: $adminmail"); 1.$new_email-to address 2._new_subject--subject(it is constant value) 3._new_mobile--mobile(constant) 4._new_conftext."\n\n$buildlink"--confirmation text with some link to activate his account 5.from--my email id the mail is working with localhost but when i upload the script to my web site it is not sending mail.i checked all the things.but still it's not working.in my php script some cgi coding is used.. please give me any suggestion. thanks mrjameer
  11. hi, i want to build a site for web hosting company using php/mysql template system/cms.as you know that the site will contain info about hosting plans,server plans,reseller plans etc..can any body know some tutorials,guidelines for building this one..any of your help will be appreciated,are there any opensource cms available for creating web hosting site. thanks in advance mrjameer
  12. hi i transferred the 1.admin,2.staff and 3.client details from an old table to new table called users.when i login using admin username and password it is allowing me to login similarly the staff,but when i login using client's username and password it is not allowing to me login.. even i enter the correct one. when the admin creates a new client(user),then that username/password is stored in db and i can login using that clients username password.but  with the old users,i cant login, it is displaying blank screen.it is not getting the old users data. here the user id is autoincrement,but i have dumped the id from other table along with usernams/passwords. when i  try to create a new user with same old username and password it is saying that user already exist with that name.here iam using $HTTP_SESSION_VARS,php 4.3.6 and mysql 4.the session_start is in begining of login script.if i use $HTTP_SESSION_VARS is there any other thing i have to add to work with it.any your help will be appreciated.can you guess why it is. thanks mrjameer
  13. hi, now it's working.thank you very much mjdamato,craygo who replied  me at correct time. thanks mrjameer
  14. hi mjdamato, it is working good.but if the field contains some text it is not inserting.it is inserting up to those rows that contains numbers .it is showing Unknown column 'aaaaa'  in 'field list'.the datatype of field userfield3 is 'text'.it is not allowing to insert text which is present in users table. thanks mrjameer
  15. hi mjdamato, you are right.there are some blank values in the userfield1 and userfield3 for id=4  and many more. i will check your code and i will reply to you. thanks mrjameer
  16. hi here is my code.but it is inserting one row from users table only and displays the error message You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '), (4, 3, )' at line 3.i have more than 1 record. <?php // connect to db1 $db1= @mysql_connect("localhost", "","") or die(mysql_error()); @mysql_select_db("suuu", $db1) or die(mysql_error()); // connect to db2 $db2= @mysql_connect("localhost","root","") or die(mysql_error()); @mysql_select_db("supportcenter1", $db2) or die(mysql_error()); $sql = "SELECT id,userfield1,userfield2,userfield3 FROM users"; $result = mysql_query($sql, $db1) OR die (mysql_error()); //$num_rows = mysql_num_rows($result); while ($row = mysql_fetch_assoc($result)) { $id=$row['id'];         $userfield1=$row['userfield1']; $userfield2=$row['userfield2']; $userfield3=$row['userfield3'];    $sql = "INSERT INTO user_values (user_id, field_id, field_value) VALUES               ($id, 1, $userfield1),               ($id, 2, $userfield2),               ($id, 3, $userfield3)";     mysql_query($sql, $db2) OR die (mysql_error()); } echo "inserted"; ?>
  17. hi iam getting the following error You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '), (1, 2, ), (1, 3, )' at line 2 mrjameer
  18. hi mjdamato, thank you very much for your reply.here i have one problem.the user table is present in one database and user_values table is present in another database.how can i connect to 2 different databases. thanks mrjameer.
  19. hi, i have 2 mysql tables first one is user table and its fields are as follows id--userfield1--userfield2--userfield3 1--87878978--56564545--53342323 second table is user_values and it's fields are user_id--field_id---field_value 1.here i want to write a insert query such that i can fetch the id from users table and store in user_values.user_id 2.the field_id value should be 1 for userfield1 and 2 for userfield2 and 3 for userfield3 in user_values table 3.fetch the userfield1 value from user and store it in field_value of user_value.finally user_values table should like this user_id--field_id---field_value 1---1---87878978 1---2---56564545 1---3---53342323. 2---1---99999999 2---2---88888888 2---3---66666666 i have 10 records in user table.how i can fetch and store these values.please guide me how i can do this. thankig you mrjameer.
  20. hi guys, we are using isolsoft customer support system for our website.our company is a web hosting company.the clients can login and post their tickets.the problem is with login system.80% of clients  can login easily but the remaining 20% some times canot login.after trying 5-6 times they will login.what do you think where the problem is.can you have any idea about it.your help will be appreciated.i think the problem is in session configuaration in php.ini file.the isolsoft has used the class DB_eSession for storing the session info in mysql db.we have contacted isolsoft many times but dont get any solution for this. thanks mrjameer
  21. hi, the login system of my website some times does not allows my clients to login.after trying 6-7 times or may be more times the client can login.this is became a big headache for us.here iam giving my custom php.ini file.can you please help me to get out of it.sessions have been used for this. thanks mrjameer custom php.ini $sess_param = array(); $sess_param['errors_path'] = '../inc/'; $sess_param['errors_file'] = 'errsess'; $sess_param['default_lang'] = 'en'; $sess_param['current_lang'] = IsSet($_SERVER['HTTP_ACCEPT_LANGUAGE']) ?                       substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) : 'en'; $sess_param['session_start'] = TRUE; $sess_param['stop_on_error'] = TRUE; $sess_param['error_color'] = 'RED'; $sess_param['error_size']  = '+0'; $sess_param['stop_on_warn'] = FALSE; $sess_param['warn_color'] = 'BLUE'; $sess_param['warn_size']  = '+0'; $sess_param['detail_err_msgs'] = FALSE; $sess_param['buffer'] = FALSE; $sess_param['key_prefix'] = 'O9R^3mp#i|34'; $sess_param['key_suffix'] = '+t97!u0K-2L5'; $sess_param['confirm_pswd'] = '!*CONFIRMED*!'; $sess_param['encrypt'] = FALSE; $sess_param['encrypt_cipher'] = (defined('MCRYPT_GOST')) ? MCRYPT_GOST : NULL; $sess_param['encrypt_mode']  = (defined('MCRYPT_MODE_CFB')) ?                                           MCRYPT_MODE_CFB    : NULL; $sess_param['gc_del_locked'] = FALSE; $sess_param['db_host'] = $connsqlhostname;      // Your host name $sess_param['db_user'] = $connlogin;      // Your user name assigned $sess_param['db_pswd'] = $connpassword;        // Your assigned password $sess_param['db_name'] = $connbase;    // Your database name $sess_param['db_persistent'] = FALSE; $sess_param['db_resource'] = NULL; $sess_param['tb_name']    = 'sessions';        // Session table name $sess_param['tb_id_col']  = 'sess_id';          // Session ID key column name $sess_param['tb_sl_col']  = 'sess_sec_level';  // Security level column name $sess_param['tb_cr_col']  = 'sess_created';    // Session created column name $sess_param['tb_ex_col']  = 'sess_expiry';      // Expiry column name $sess_param['tb_to_col']  = 'sess_timeout';    // Session timeout column name $sess_param['tb_lk_col']  = 'sess_locked';      // Session locked column name $sess_param['tb_vl_col']  = 'sess_value';      // Session data column name $sess_param['tb_iv_col']  = 'sess_enc_iv';      // Session encrypt IV col. name $sess_param['tb_si_col']  = 'sess_sec_id';      // Session security ID column $sess_param['tb_tr_col']  = 'sess_trace';      // Session trace column name $sess_param['security_level'] = 128;            // Range 0-255 $sess_param['new_sid'] = FALSE; $sess_param['sess_id'] = NULL; $sess_param['sess_id_len'] = 32; $sess_param['ie_fix'] = FALSE; $sess_param['slash_anyway'] = TRUE; $sess_param['strip_anyway'] = TRUE; $sess_param['save_path'] = $connbase;      // Set to name of database $sess_param['name'] = 'CSESSION';              // Assign your own session name //$sess_param['auto_start'] = '1';                // 1 = auto start, 0 = off //$sess_param['gc_probability'] = 10;            // Garbage Collection //$sess_param['gc_divisor'] = 100; //$sess_param['gc_maxlifetime'] = 1440; //$sess_param['timeout'] = $sess_param['gc_maxlifetime'] * 3; //$sess_param['serialize_handler'] = 'php'; //$sess_param['cookie_lifetime'] = 0; //$sess_param['cookie_path'] = '/'; //$sess_param['cookie_domain'] = ''; //$sess_param['cookie_secure'] = '0'; //$sess_param['use_cookies'] = 1; //$sess_param['use_only_cookies'] = 0;      // For PHP version >= 4.3.0 //$sess_param['referer_check'] = ''; //$sess_param['entropy_file'] = ''; //$sess_param['entropy_length'] = 0; //$sess_param['cache_limiter'] = 'nocache'; //$sess_param['cache_expire'] = 180;        // For PHP version >= 4.2.0 //$sess_param['bug_compat_42'] = 1; //$sess_param['bug_compat_warn'] = 1; //$sess_param['use_trans_sid'] = 1; //$sess_param['hash_function'] = 0; //$sess_param['hash_bits_per_character'] = 4; //$sess_param['tags'] = 'a=href,area=href,frame=src,iframe=src,form=,fieldset=,input=src';
  22. hi, can any body tell me how to make a website secure with the session variable configuration in php.ini file mrjameer
  23. hi, i want to know is there any online php script validators are available.i want to validate my php scripts so that i can know is there any bugs or errors present in my scripts.i want to write my scripts  in professional way. your help will be appreciated thanks mrjameer
  24. hi, i want to send a mail to my client.in that mail my client should receive the message and should receive a link.when he clicks that link a small window should be open,so that he can send reply to me and once he press submit button then the link shoud die.i want to do with javascript/php.how i can do this please help me. thanks mrjameer
  25. hi, i have a mysql table which contains client details. fields are as follows 1.name  2.mailid        3.sendmail  4.status 1.abc    2.abc@yahoo.com  3.send      4.not updated 1.xyz    2.xyz@hotmail.com 3.send      4.not updated here 'send' is the link and when i click on it, it opens a email form to send mail to abc@yahoo.com or xyz@hotmail.com.i want to know how i can select the mailid from db when i click on 'send' link and print it on email form and i should send mail to that mail id.after sending mail to a person here 'status' should be updated. your help will be appreciated thanks mrjameer
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.