Jump to content

saikiran

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Everything posted by saikiran

  1. hi, this is how i am calling it into the popup. sorry for not putting the popup one <?php include_once('config.php'); $psql = "select * from bhakt_photo"; $result = mysql_query($psql); if($result) {     while($row = mysql_fetch_array($result,MYSQL_BOTH))     {         echo "<table>";         echo "<tr>";         echo "<td>";?> [b]<a  href="javascript:;" onClick = "window.open('bhakti_popnew.php?id=<?php echo $row['id'];?>','Gallery','height=700,width=589,scrolling=yes')"><img src="http://www.seher.in/uploads/<?php echo $row['mid_img'];?>" border="0" ></a>[/b]         <?php         echo "</td>";         echo "</table>";     } } ?> cheers saikiran
  2. hi, I am running a photo gallery in my site. in which , i am having a thumbnail page and a popup image page, what i am doing is when user clicks the thumbnail, the bigger picture should open in a popup in a separate page. I would like to add a navigation link in the popup page. i.e. with in the popup page, user can go and view the rest of the images in the gallery also. [color=red]i am providing this as 1,2 ,3,4,5.....[Next][Previous] .  format. i am not able to run the navigation part properly....[/color] This is what the code for the 2 pages: [color=red]Thumbnails page code [/color] [code]<?php include_once('config.php'); $psql = "select * from bhakt_photo"; $result = mysql_query($psql); if($result) {     while($row = mysql_fetch_array($result,MYSQL_BOTH))     {         echo "<table>";         echo "<tr>";         echo "<td>";?>         <a  href='bhakti_popnew.php?id=<?php echo $row['id'];?>'><img src="http://www.seher.in/gall_upload/ <?php echo $row['mid_img'];?>" border="0" ></a>              <?php         echo "</td>";         echo "</table>";     } } ?> [/code] -----Popup page code------------- [code]<?php include('config.php'); //new code $id=$_GET['id']; //this the Id i am getting for the images // how many rows to show per page $rowsPerPage = 1; // by default we show first page $pageNum = 1; // if $_GET['page'] defined, use it as page number if(isset($_GET['page'])) {     $pageNum = $_GET['page']; } // counting the offset $offset = ($pageNum - 1) * $rowsPerPage; //$offset =  $rowsPerPage; $query = " SELECT * FROM bhakt_photo where id=$id " .         " LIMIT $offset, $rowsPerPage"; echo $query."<br>"        ; $result = mysql_query($query) or die('Error, query failed'); ?> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">         <?php         while($row = mysql_fetch_array($result))         {             echo $row['big_img'];         } ?>       </table>       <br> <br> <?php // how many rows we have in database $query  = "SELECT COUNT(big_img) AS numrows FROM bhakt_photo "; $result  = mysql_query($query) or die('Error, query failed'); $row    = mysql_fetch_array($result, MYSQL_ASSOC); $numrows = $row['numrows']; // how many pages we have when using paging? $maxPage = ceil($numrows/$rowsPerPage); // print the link to access each page $self = $_SERVER['PHP_SELF']; $nav  = ''; for($page = 1; $page <= $maxPage; $page++) {   if ($page == $pageNum)   {       $nav .= " $page "; // no need to create a link to current page       }   else   {        $nav .= " <a href=\"$self?page=$page\">$page</a> ";          } } if ($pageNum > 1) {   $page  = $pageNum - 1;        $id  = $id-1;     $prev  = " <a href=\"$self?page=$page&id=$id\">[Prev]</a> ";   $first = " <a href=\"$self?page=1&id=$id\">[First Page]</a> ";     //$prev  = " <a href=\"$self?page=$page\">[Prev]</a> ";   //$first = " <a href=\"$self?page=1\">[First Page]</a> "; } else {   $prev  = '&nbsp;'; // we're on page one, don't print previous link   $first = '&nbsp;'; // nor the first page link } if ($pageNum < $maxPage) {   $page = $pageNum + 1;    $id = $id +1;     echo "<b>". $id."<br>";       $next = " <a href=\"$self?page=$page&id=$id\">[Next]</a> ";       $last = " <a href=\"$self?page=$maxPage&id=$id\">[Last Page]</a> ";       //$next = " <a href=\"$self?page=$page\">[Next]</a> ";       //$last = " <a href=\"$self?page=$maxPage\">[Last Page]</a> "; } else {   $next = '&nbsp;'; // we're on the last page, don't print next link   $last = '&nbsp;'; // nor the last page link } // print the navigation link echo $first . $prev . $nav . $next . $last; // and close the database connection // ... and we're done! ?>[/code] the problem what i assume is - the 'id' value is not passing in the subsquent pages properly. i have checked readymade photogallery packages...but i would like to have my own. I am not an expert in PHP too. can anyone just tell me whats the problem in my code and help me out in completing this one. cheers saikiran saisen76@hotmail.com
  3. hi, one small doubt once again, i am clear upto getting the latest row id and storing it in another table, and while clicking the download link, we have to check whether the id is greater than the stored one, in this case, does we have to use join with the two tables using the id column..if yes then what will be the syntax for join. [quote]$sql1 = "select * from table1, table2, where table1.id=table2.id && table2.id>$last_value";[/quote] just tell me whether i am doing it wrong or right. thank you once again cheers saikiran
  4. hi, This is wat i am looking for , i hope so....let me work in this way... i hope, this will solve my problem probably. Thank you once again for your suggestions cheers saikiran
  5. hi, [quote]The query checks where something is something For example you have a field with id_num SELECT * FROM table WHERE id_num > 15; This should show all results where id_num is over 15 (16, 17, 18....[/quote] Sorry to say this.... i am still not able to understand.How could i generate a latest back up of a table using the above script. Suppose, assume that id_num is my auto-generated record id, how could i know, whether this is the latest back up or not ???? cheers saikiran
  6. hi, [quote]$sql = "select * from blocked_temp_cus" WHERE x = 'y'[/quote] Thank you for your reply. But, i am not a php expert, what i understand from your code is that, we have to add one column or field, which will check for some value Y/N to be there. If it is Yes, then it will execute the script ? Can you please elaborate it so that i can do the rest . cheers saikiran
  7. hi, I am developing an web-app, where the client can download the database table as a .csv file. I am doing this using the below script [quote]<? header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); // HTTP/1.0 header("Cache-control: private"); header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=block_registration.csv"); header("Content-Type: application/octet-stream"); header("Content-Transfer-Encoding: binary"); require ("config.php"); //db connection $sql = "select * from blocked_temp_cus"; $result = mysql_query($sql); if ($result){ //$sql = "select * from ads"; //$result = mysql_query($sql,$conn); $count = mysql_num_fields($result); while ($rows = mysql_fetch_array($result)){ for ($i=0;$i<$count;$i++){ echo $rows[$i].", "; //data } echo "\n"; //new line } } ?>[/quote] This works pretty well. Everytime, they click the download link, this file generates the .csv file and puts all the rows into the excel sheet completely. [color=red]Everytime, when user presses , we are getting the full table [/color] [color=red]Now, what we want is whenever we click the link, i want to download the latest records that i have inserted, instead of downloading the complete table once again.[/color] Can anyone help me out in this regard. cheers saikiran saisen76@hotmail.com
  8. hi redarrow, Thank you for your reply. while executing the code [quote]<?php     @mysql_connect("localhost", "admin", "maaindia") or die("ERROR--CAN'T CONNECT TO SERVER");     @mysql_select_db("shobhacards") or die("ERROR--CAN'T CONNECT TO DB");     $limit          = 2;                  $query_count    = "SELECT count(*) FROM prod_catlog2";      $result_count  = mysql_query($query_count);       $totalrows      = mysql_num_rows($result_count);     echo $totalrows." ";   global $page;     if(empty($page)){         $page = 1;     }           $limitvalue = $page * $limit - ($limit);     $query  = "SELECT * FROM prod_catlog2 LIMIT $limitvalue, $limit";          $result = mysql_query($query) or die("Error: " . mysql_error());     if(mysql_num_rows($result) == 0){         echo("Nothing to Display!");     }     $bgcolor = "#E0E0E0"; // light gray     echo("<table>");       while($row = mysql_fetch_array($result)){         if ($bgcolor == "#E0E0E0"){             $bgcolor = "#FFFFFF";         }else{             $bgcolor = "#E0E0E0";         }     echo("<tr bgcolor=".$bgcolor.">n<td>");     echo($row["Product"]);     echo("</td>n<td>");     echo($row["Sno"]);     echo("</td>n</tr>");     }     echo("</table>");     if($page != 1){         $pageprev = $page--;               "<a href=\"$PHP_SELF&page=$pageprev\">PREV".$limit."[/url] ";         //echo('<a href="disp.php&page=$pageprev">PREV'.$limit.'[/url]');     }else{         echo("PREV".$limit." ");     }     $numofpages = $totalrows / $limit;       echo $numofpages." ";       for($i = 1; $i <= $numofpages; $i++){         if($i == $page){             echo($i." ");         }else{                       echo("<a href=\"$PHP_SELF&page=$i\">$i[/url] ");           //echo "<a href='disp.php?page='$i''>$i[/url]";             //echo('<a href="disp.php?page=$i">'.'$i'.'[/url]' );         }     }     if(($totalrows % $limit) != 0){         if($i == $page){             echo($i." ");         }else{           echo("<a href=\"$PHP_SELF&page=$i\">$i[/url] ");         }     }     if(($totalrows - ($limit * $page)) > 0){         $pagenext = $page++;           echo("<a href=\"$PHP_SELF?page=$pagenext\">NEXT".$limit."[/url]");     }else{         echo("NEXT".$limit);     }       mysql_free_result($result); ?>[/quote] i am not getting any error, instead i am not able to traverse through my records with the back and prev button , as they are not showing the link at all. if i give something like this [color=red]http://localhost/gal.php?page = 1 0r 2 0r 3[/color]...., then it is showing that particular page. What i feel is the problem is with the navigation link part. if you can put some time...i hope you can help me out. cheers saikiran
  9. hi to all, I tried out the above script, but i am not getting the desirable output. What i want is this, i have image thumbnails which are placed in a page. When user clicks any single thumbnail, it has to open a gallery page which has many images (from database) with medium size. From here, if user presses one image, it should open a popup a show that image in bigger size. I have to provide back and next button facility in both the pages. kindly help me out in how to do it. cheers sai
  10. hi, I am using this script as it is to check the pagination script. [quote]<?php     @mysql_connect($localhost, $user, $password) or die("ERROR--CAN'T CONNECT TO SERVER");     @mysql_select_db($database) or die("ERROR--CAN'T CONNECT TO DB");     [color=red]$limit          = 10;              [/color]     $query_count    = "SELECT count(*) FROM table";        $result_count  = mysql_query($query_count);        $totalrows      = mysql_num_rows($result_count);     if(empty($page)){         $page = 1;     }             $limitvalue = $page * $limit - ($limit);     $query  = "SELECT * FROM table LIMIT $limitvalue, $limit";            $result = mysql_query($query) or die("Error: " . mysql_error());     if(mysql_num_rows($result) == 0){         echo("Nothing to Display!");     }     $bgcolor = "#E0E0E0"; // light gray     echo("<table>");         while($row = mysql_fetch_array($result)){         if ($bgcolor == "#E0E0E0"){             $bgcolor = "#FFFFFF";         }else{             $bgcolor = "#E0E0E0";         }     echo("<tr bgcolor=".$bgcolor.">n<td>");     echo($row["users"]);     echo("</td>n<td>");     echo($row["usersID"]);     echo("</td>n</tr>");     }     echo("</table>");     if($page != 1){         $pageprev = $page--;                 echo("<a href="$PHP_SELF&page=$pageprev">PREV".$limit."</a> ");     }else{         echo("PREV".$limit." ");     }     $numofpages = $totalrows / $limit;         for($i = 1; $i <= $numofpages; $i++){         if($i == $page){             echo($i." ");         }else{             echo("<a href="$PHP_SELF?page=$i">$i</a> ");         }     }     if(($totalrows % $limit) != 0){         if($i == $page){             echo($i." ");         }else{             echo("<a href="$PHP_SELF?page=$i">$i</a> ");         }     }     if(($totalrows - ($limit * $page)) > 0){         $pagenext = $page++;                 echo("<a href="$PHP_SELF?page=$pagenext">NEXT".$limit."</a>");     }else{         echo("NEXT".$limit);     }         mysql_free_result($result); ?> [/quote] i have modified the same script 100%, just to check with my database table. What i did is changed the limit as 2 [color=red]<?php     @mysql_connect("localhost", "admin", "maaindia") or die("ERROR--CAN'T CONNECT TO SERVER");     @mysql_select_db("shobhacards") or die("ERROR--CAN'T CONNECT TO DB");     $limit          = 2;                  $query_count    = "SELECT count(*) FROM prod_catlog2";        $result_count  = mysql_query($query_count);          $totalrows      = mysql_num_rows($result_count);     echo $totalrows."<br>"; global $page;     if(empty($page)){         $page = 1;     }             $limitvalue = $page * $limit - ($limit);     $query  = "SELECT * FROM prod_catlog2 LIMIT $limitvalue, $limit";            $result = mysql_query($query) or die("Error: " . mysql_error());     if(mysql_num_rows($result) == 0){         echo("Nothing to Display!");     }     $bgcolor = "#E0E0E0"; // light gray     echo("<table>");         while($row = mysql_fetch_array($result)){         if ($bgcolor == "#E0E0E0"){             $bgcolor = "#FFFFFF";         }else{             $bgcolor = "#E0E0E0";         }     echo("<tr bgcolor=".$bgcolor.">n<td>");     echo($row["Product"]);     echo("</td>n<td>");     echo($row["Sno"]);     echo("</td>n</tr>");     }     echo("</table>");     if($page != 1){         $pageprev = $page--;                 "<a href=\"$PHP_SELF&page=$pageprev\">PREV".$limit."</a> ";         //echo('<a href="disp.php&page=$pageprev">PREV'.$limit.'</a>');     }else{         echo("PREV".$limit." ");     }     $numofpages = $totalrows / $limit;         echo $numofpages."<br>";         for($i = 1; $i <= $numofpages; $i++){         if($i == $page){             echo($i." ");         }else{                     echo("<a href=\"$PHP_SELF&page=$i\">$i</a> ");          //echo "<a href='disp.php?page='$i''>$i</a>";             //echo('<a href="disp.php?page=$i">'.'$i'.'</a>' );         }     }     if(($totalrows % $limit) != 0){         if($i == $page){             echo($i." ");         }else{         echo("<a href=\"$PHP_SELF&page=$i\">$i</a> ");         }     }     if(($totalrows - ($limit * $page)) > 0){         $pagenext = $page++;           echo("<a href=\"$PHP_SELF?page=$pagenext\">NEXT".$limit."</a>");     }else{         echo("NEXT".$limit);     }         mysql_free_result($result); ?>[/color] i am using the same $PHP_SELF only, can anyone find this and correct what wrong with this code. Also, instead of page numbers, i want to show just back and next and navigate to single record (image photo gallery type) suggestions and some links will be helpful. cheers sai
  11. i, thank you for the links. i will check it out as it as and get back to you.I hope my problem will be solved with this code. cheers sai
  12. hi, [color=red]I want to create a Image Gallery. The images are stored in a folder and while be linked with database table.The file name will be stored in the table and retrived and resolved using <img src="<?php echo ./uploads/$row['img_name']">.[/color] I want to add pagination facility in it. Some thing like [color=red]Back and Next buttons[/color], so that at a time 6 images will be displayed, by clicking next button, the next set of images should come... while clicking the [color=red]thumbnails, the image should be opened in a separate popup window. In the popup window also, we have to put next and back functionality.[/color] can anyone show me some tutorial or link for doing this. cheers saikiran saisen76@hotmail.com
  13. hi, Thank for your idea. when they are logging in i am just checking whether their email and password are correct and existing, If yes, i redirect them to their personalized page. In this case, along with email and password, i want to check with the field block also. I hope i am right. the sql code will be something like this sql = select * from customers where cust_email='{$_POST['cust_email']}' && cust_pass = '{$_POST['cust_pass']}' && blocked = 'true' i hope this is what , i have to do inorder to block the user. cheers saikiran
  14. hi just-j, thank your for your valuable idea, to be frank, i am just getting into PHP, yes i have a fair knowledge of using Sessions, but for the second idea, you have put forth, if you could help me out with some tutorial or code link, it would be appreciated. But, as you have mentioned, apart from these how could we do this, as this is a must for our system. cheers saikiran
  15. hi, I am creating an online order processing system, which has got personalized login system with registration process. What i do is this: 1) Accept registration through a form 2)Activate the registration, and send a random password, to the registered user email 3)After become member, they can access my order processing system and can view my company stocks and query for some stocks. [color=red]What i want, is after registering an user, if i feel the user is not genuine, i want to cancel the user's registration and to block that user.[/color] how to go abt this. i am using PHP 4.0/Wind XP/IIS cheers saikiran
  16. hi localhost, 2)  as keeB, has pointed out, you can use the above two methods. i just want to remind you if you already know about working with header, then this is of no use for you,. Make sure that no code should be executed before the header command.It means no echo statements, no blank spaces or no html output should come before the header statement. cheers sai
  17. hi keeB, i want this option so that user can edit there values if they want to . I have seen this is normal shopping cart sites, where in which we can anytime update the quantity values or how much we want. I know they are made of pure PHP, in my case, it is not a shopping cart, so i am just looking for a quick work for this. if you know, kindly tell me the logic for this. [color=red][quote]note: I am not using browser's back button directly, there will be a button called update, when user clicks this button then it should go.[/quote][/color] cheers sai saisen76@hotmail.com
  18. hi, this is how i use to connect with my database . if it works for you, then just go ahead and try..i too got lots of help from this forum. just create a file config.php [color=red]<?php $server = 'localhost'; $user_name ='admin' //my user name $pw = 'ijk' //password to connect with MySQL $db = 'test' //the database $link = mysql_connect($server,$user,$pw) if(!$link) {   echo 'No connection is found '; }else {   mysql_select_db($db,$link) or die('Connection found.No database found'); } ?> [/color] now in your php file, just add this line (process.php) [color=red]<?php include_once('config.php');?> <?php   $name=$_POST['name']; $email=$_POST['email']; $location=$_POST['location']; sql = "insert into table (name, email,location) values ('$name', '$email', '$location') "; $result=mysql_query($sql,$link) or die('Error in inserting values'); if(!$result) {           echo 'mysql_errno().mysql_error()'; } ?>[/color] This way, you can find the errors easily. anyother method if anyone knows that is better, pls tell to me. i hope this will help u cheers sai
  19. hi, Thank u all. for the last two problems, i have posted, i got the answer and i finished it also. thank you very much. I just want to know, whether it is possible for retaining posted form values, when user presses the back buttton which is using the javascript history command. What i want to do is, when user posted the values, i have to take them to the confirmation or update page, if they press confirm, then the values will be stored into our database, if they press update, they have to go back to the previous and can edit the values. Here the form is dynamically generated using PHP. I tried this, i can able to go back, but not able to get the form values. kindly help me out. the script is [color=red].... <script> function doBack() { history.go(-1); } </script>[/color] .... [size=10pt]the form is [/size] [color=red]<?php echo "<form method='POST' action='ord_confirm.php' name='confirm_form'>"; echo "<input type='hidden' name='Sno{$j}' value='{$GLOBALS['item_no']}'>"; echo "<input type='hidden' name='pr_cat{$j}' value='{$GLOBALS['prod_cat']}'>"; echo "<input type='hidden' name='qty_req{$j}' value='{$GLOBALS['qty']}'>"; echo "<input type='hidden' name='gsm{$j}' value='{$GLOBALS['gsm']}'>"; echo "<input type='hidden' name='desc{$j}' value='{$GLOBALS['desc']}'>"; echo "<input type='hidden' name='quality{$j}' value='{$GLOBALS['quality']}'>"; echo "<input type='hidden' name='width{$j}' value='{$GLOBALS['width']}'>"; echo "<input type='hidden' name='length{$j}' value='{$GLOBALS['length']}'>"; echo "<input type='hidden' name='quan{$j}' value='{$GLOBALS['quan']}'>"; echo "<input type='hidden' name='unit{$j}' value='{$GLOBALS['unit']}'>"; echo "<input type='hidden' name='price{$j}' value='{$GLOBALS['price']}'>"; echo "<input type='hidden' name='uprice{$j}' value='{$GLOBALS['uprice']}'>"; echo "<input type='hidden' name='remark{$j}' value='{$GLOBALS['remark']}'>"; echo "<input type='hidden' name='dis{$j}' value='{$GLOBALS['dis']}'>"; echo "<input type='hidden' name='un_k{$j}' value='{$GLOBALS['un_k']}'>"; //echo "<input type='hidden' name='un_k{$j}' value='{$GLOBALS['un_k']}'>"; $j++;                   <?php }                 echo "<input name='ret_tot' type='hidden' value='$j'>"; echo "<input type='hidden' name='enq_type' value='$enq_type'>"; echo "<input type='submit' name='ok' value='CONFIRM'>"; echo "<input type='reset' name='cancel' value='CANCEL' onclick='doBack();'";         echo "</form>"; [/color] cheers sai
  20. hi all, i have got responses but still pretty much confused abt where to check the code for email. what i did was just copy pasted the code given by chips and now i am getting nothing on my file, when i submit the form. This is what i did. May be wrong as i am not that much expert in PHP I convered my form file to a PHP file reg.php [color=red]<?php include_once('config.php'); $sql = "select cust_id from temp_customer"; $result = mysql_query($sql); $row = mysql_fetch_array($result,MYSQL_BOTH); $id = $row['cust_id']; ?>[/color] <html> <head><title>New User Registration</title></head> <form method="POST" action="newUser.php"> <table> <tr> <td> Enter Your Name</td> <td><input type="text" name="t1"> *</td> </tr> <tr> <td>Enter a valid Email</td> <td><input type=" text" name="t2"> *</td> </tr> <tr> <td>Company Name</td> <td><input type=" text" name="t3"> *</td> </tr> <tr> <td>Address1</td> <td><input type=" text" name="t4"> *</td> </tr> <tr> <td>Address2</td> <td><input type=" text" name="t5"></td> </tr> <tr> <td>City</td> <td><input type=" text" name="t6"> *</td> </tr> <tr> <td>State</td> <td><input type=" text" name="t7"> *</td> </tr> <tr> <td> Pincode</td> <td><input type=" text" name="t8"> *</td> </tr> <tr> <td>Phone Number</td> <td><input type=" text" name="t9"></td> </tr> <tr> <td>Fax</td> <td><input type=" text" name="t10"></td> <input type="hidden" name="cust_id" value="[color=red]<?php echo $id ;  ?>[/color]" /> </tr> <tr> <td> <input type="submit" value="Register"></td> </tr> </form> <p><font face="arial" color="Red"> * - Has to be Filled by the user </p> </html> newUser.php has been modified according to Chips. [color=red]<?php include_once('config.php'); global $msg1; $cust_id = $_POST['cust_id']; $name = $_POST['name']; $email = $_POST['email']; $com_name =$_POST['com_name']; $add1 =$_POST['address1']; $add2 =$_POST['address2']; $city =$_POST['city']; $state =$_POST['state']; $pin =$_POST['pincode']; $phone_num =$_POST['phone']; $fax =$_POST['fax']; if($_POST['Submit']) { $sql = "select * from temp_customer where cust_id='$cust_id'"; echo $sql; $result=mysql_query($sql); while($row=mysql_fetch_assoc($result)) { if($row['cust_email'] > 0){ echo "The E-mail has been already taken "; //$msg1 = "The E-mail has been already taken "; } } }?> [/color] i am just echoing whether the query is executing. When i tried to insert the same with same email ID, in this case nothing is happening. It is just echoing the sql and stays quiet. pls suggest me if i am wrong...can anyone send me the full code they are using for this. that would be very much helpful as i can go through it fully. thank u for your support cheers sai
  21. hi, Thank u for ur help cmgmyr and redarrow, thats what logically i am wrong that while inserting the data i am not checking whether the email ID exists or not. One more mistake i did is telling that email is my PKey, it is not the PKey for me, sorry for that. now, my question is after collecting all the posted data into the newUser.php file, where should i write the query for checking the email ID is existing !!!. to Redarrow [color=red][quote]$query="select * from users where id=$id"; $result=mysql_query($query); while($row=mysql_fetch_assoc($result){ if($row['email'] > 0) { echo "Sorry email tacken please use another one cheers! <a href='what_ever_you_called_this_page.php'>Please Try Agin[/url]": exit; }[/quote][/color] kindly help me out. if i am not online, you can mail to me also, as this is very urgent. cheers saikiran saisen76@hotmail.com
  22. hi all, i am very much happy about this forum that on my first post itself, i got the help. Very thank you. now my second problem is this.I am creating a simple user registration system, in which i am using email as my Primary Key, Whenever user fiils the form and submit it, i should check for the existence of the emailID, if exists i should tell them, the user ID or email is existing or i have to register them and send a mail to their email id for activation. the files are Register.html [color=red]<html> <head><title>New User Registration</title></head> <form method="POST" action="newUser.php"> <table> <tr> <td> Enter Your Name</td> <td><input type="text" name="t1"> *</td> </tr> <tr> <td>Enter a valid Email</td> <td><input type=" text" name="t2"> *</td> </tr> <tr> <td>Company Name</td> <td><input type=" text" name="t3"> *</td> </tr> <tr> <td>Address1</td> <td><input type=" text" name="t4"> *</td> </tr> <tr> <td>Address2</td> <td><input type=" text" name="t5"></td> </tr> <tr> <td>City</td> <td><input type=" text" name="t6"> *</td> </tr> <tr> <td>State</td> <td><input type=" text" name="t7"> *</td> </tr> <tr> <td> Pincode</td> <td><input type=" text" name="t8"> *</td> </tr> <tr> <td>Phone Number</td> <td><input type=" text" name="t9"></td> </tr> <tr> <td>Fax</td> <td><input type=" text" name="t10"></td> </tr> <tr> <td> <input type="submit" value="Register"></td> </tr> </form> <p><font face="arial" color="Red"> * - Has to be Filled by the user </p> </html> [/color] [color=brown]newUser.php <?php include_once('config.php'); if($_POST['submit']) { $name = $_POST['t1']; $email = $_POST['t2']; $com_name =$_POST['t3']; $add1 =$_POST['t4']; $add2 =$_POST['t5']; $city =$_POST['t6']; $state =$_POST['t7']; $pin =$_POST['t8']; $phone_num =$_POST['t9']; $fax =$_POST['t10']; $sql = "insert into temp_customer (cust_name,cust_email,cust_company, cust_add1, cust_add2, cust_city, cust_state,cust_pin, cust_phone, cust_fax) values ('$name','$email','$com_name','$add1','$add2','$city','$state', '$pin','$phone_num','$fax')"; $result = mysql_query($sql)or die('Error in coding'.mysql_errno().mysql_error()); if($result) { $msg = 'Your request has been posted. Thanks for registering.After the processing, you will be intimated about your registration.'; $to="mail@shobhacards.com,lngworks@yahoo.com"; $subject="New User Registration Request"; $messg="A User has requsted for the membership.Kindly Check your administration panel for further details"; mail($to,$subject,$messg); }else { $msg = "Request is not been processed.Try again later"; } } ?> ... <html> ..... <?php echo $msg ?> [/color] this code works fine for me, but when user enter the same email id, in the newUser.php i am not getting any messages ? kindly look into this code cheers saikiran saisen76@hotmail.com
  23. hi, Thank u AV1611. You  have solved my problem. Thank you once again. cheers saikiran
  24. hi, First post in this forum i am using a drop down select menu to choose a particular category of products from my database table. I want to give one default option in the select menu, Select ALL, whenever user select this and press the submit button it should retrieve all the records. kindly check out the below given code and help me out. Dynamic select menu code [color=red]<?php include('config.php');?> <? $query = "SELECT distinct product FROM prod_catlog2";   $result = mysql_query($query);     $pulldown = '<option>Select one option</option>';   while($row=mysql_fetch_array($result,MYSQL_ASSOC))   {   $pulldown .= "<option value  = \"{$row['product']}\">{$row['product']}</option>\n";   }?>     <html> <title>Order Form</title> <form action="show_ord_det_pg_org.php" method="POST"> Select your category<select name="cat"> <?php echo $pulldown;?>  </select> <br> <input type="submit" name="submit" value="Show Details"> </form> </html>[/color] [b]show_ord_det_pg_org.php[/b] [color=red]... <?php   $cat = $_POST['cat'];   $sql = "select * from prod_catlog2 where product = '$cat'";   $result = mysql_query($sql)or die(mysql_errno().mysql_error());?>  .... [/color] here $cat is the variable which stores the option that user will pick from the select menu, whose name is cat. kindly help me out cheers sai saisen76@hotmail.com
×
×
  • 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.