Jump to content

joshi_v

Members
  • Posts

    168
  • Joined

  • Last visited

    Never

Everything posted by joshi_v

  1. Hi Replace this in your code <form action="<?php echo( $self ); ?>" method="post"> with <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> and try. Regards Joshi.
  2. Try this! value='<?=html_entity_decode($fieldname);?>' Regards, Joshi.
  3. Why we u r using mysql_query two times? try this $model_query = "select products_model from orders_products where orders_id = '" . (int)$orders['orders_id'] . "' and products_model = 'CBT-0100' "; $result = mysql_query($model_query) or die (mysql_error()); if($result) { $studentsquery = mysql_query("insert into students (students_id, customers_id, students_pmodel, students_email, students_mod1, students_mod2, students_mod3, students_manual, students_cert) values ('', '" . (int)$customer_id['customers_id'] . "', 'CBT-0100', 'INSERT - CUSTOMER ID HERE', '', '', '', '', '')") or die (mysql_error()); } else {      echo ''; } If still u have errors , print the query (echo $model_query) on browser and copy the query.then execute the same query in db ,see the errors what it is showing. Happy Coding!
  4. Hello, Can u post a piece of code of u r first file and the second file name.So that any one could understand what u r trying to do. Regards, Joshi.
  5. Include this line after the code , from where you want to redirect the file.
  6. Hi Try this. Instead of directly opening a window when u click on the link, pass all the variables u need to pass to the new window through javascript function.like, <a href="" onClick = "return window_open(<?=$res[$img][sci_id]?>)";> Write a javascript function to perform the required actions before opening a new window. function window_open(passed_value) { if(confirm("Are you sure you want to continue?")) { window.open('view_full_image.php?imgid=passed_value','','top=50,left=50,width=600,height=600,scrollbars=yes') ; } else { alert("Nothing happened"); } } Hope it will helps you!
  7. Hi, If main.php register a session variable and assign a value to it sesssion_register("session_name"); $_SESSION["session_name"] = "Assign value"; in page.php you can access this by printing or by assigning this session variable to another variable. echo $_SESSION["session_name"]; $some_variable=$_SESSION["session_name"]; Happy Coding :)
  8. In ipload.php file when u r displaying rows use an increment counter to keep track of row number else u can use for loop also.. like this $num_rows=mysql_num_rows($result); for($i=0;$i<$num_rows;$i++) { $res=mysql_fetch_array($result)); } else $i=0; in while loop increment the i counter . Next when u displaying the form fields like  <td><input class="form" type="text" size="3" name="p" value="<?=$row['p']; ?>"></td> replace it with this <td><input class="form" type="text" size="3" name="p<?php echo $i; ?> value="<?=$row['p']; ?>"></td> at the end of the form pass a hidden variable with number of rows value <input type="hidden" name="num_rows" value="<?=$num_rows;?>> Do the same for all other form fields. after submission of the form, take another for or while loop for($i=0;$i<$num_rows;$i++) { $team = $_POST['team']; $p = $_POST[p.$i]; $w = $_POST[w.$i]; $d = $_POST[d.$i]; $l = $_POST[l.$i]; $for = $_POST[for.$i]; $against = $_POST[against.$i]; $diff = $_POST[diff.$i]; $pts = $_POST[pts.$i]; mysql_select_db("rufc"); $sql = "UPDATE league SET team='$team', p='$p', w='$w', d='$d', l='$l', for='$for', against='$against', diff='$diff', pts='$pts' "; mysql_query($sql);   echo "The selected information was updated! ";   echo "<a href='league.php'>Click here</a> to continue";   echo $sql; } ?> Hope this will help you Cheers :)
  9. Check this <?php $to      = 'nobody@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n" .     'Reply-To: webmaster@example.com' . "\r\n" .     'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> Cheers :)
  10. Try this! $handle = fopen("filename","r"); for($i=0;$i<10;$i++) {     $str=fgets($handle,4096);     echo  $str; } This will workd when u have new line characters in yur fle. cheers :) cheers :)
  11. Ok. If you want to insert all the fields in to same table try this if($empid) insert into `table name` (id,empid) values(id,$empid); if($name $$ $name) update 'table name' set name ='$name' where id ='id value' //Here i am assuming that u r not doing auto incrementing of the id .so here u have to insert previous id ur are using for empid. else here u have to write an insert query same for other fields also. If in case u want to insert into different  tabel it is much easier than previous one Just write an insert query for each and every field. Hope it will helps Cheers :)
  12. <?php // initialize a session session_start(); ?> <html> <head></head> <body> <?php if (!isset($_SESSION['login']) && !isset($_POST['user'])) {     // if no data, print the form ?>     <form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">       Username:<input type="text" name='user'><br>   Password:<input type="text" name='pass'><br>         <input type="submit" name="submit">     </form> <?php } else if (!isset($_SESSION['login'])) {     // if a session does not exist but the form has been submitted     // check to see if the form has all required values     // create a new session   if (empty($_POST['user']) && (empty($_POST['pass']))) { echo "Please insert your username"; echo "Please insert your password"; }   if (empty($_POST['user']))   {       echo "Please insert your username";   } if (empty($_POST['pass']))   {   echo "Please insert your username"; } } ?> </body> </html> Just use this code.. where you are doing mistake is unnecessary paranthesis closing brackets and Open curl braces.at the end of the line 24 i added one closing paranthesis. cheers :)
  13. I hope you are trying to display the display the product name which is selected by user to make an enquiry about that field and display that name in textfield. In first file use the POST method to pass the values to next file and in enquiry form for the textfield put like this.. Product Name : <inut name="product_name" type="text" value=<?php echo $_POST['product_name'];?> This post variable is passing from first form and it will display the product selected by user . Hope this will help you Cheers:)
  14. I haven't understand completly what u trying to point.But what i am feeling is u have a problem with passing id value to display the complete record when the user clicks on the id(am i right?).   So..for that in u r href link in first code file put ''filepath/1.php?id=<?php echo $idfield;?>.. when u click on that link it leads to 1.php file with id value to display the complete record ,based on that id value you are  passing to it. Hope i haven't confuse you.if it so please try to make point clear little bit more. Cheers :)
  15. Hi, Remove the white spaces for the date fields,else my suggestion is convert the date type form varchar to  date field with(10) chars length.Because when you are comparing date wise fields,because of white spaces in date, it is not retrieving properly. Rest, everything is looking fine.
  16. If you are passing some variables with link(i mean GET method) make sure all the variables are passing properly.Before that try to visit the URL which not working, by directly typing that URL in browser. Regards, Joshi
  17. Hi everybody, I had excel sheet creation program ,which is getting data from Mysql Database.Everything is working fine.Only the problem is when opening an excel sheet, a dialog box appearing before displaying data in table format with the message "Problems came up in the following areas during upload" and that area is 'Table'.if i click on 'Ok' it is showing data properly.   This error is not showing  in Testing servers but in production it is.Please help me  :( Thanks.
×
×
  • 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.