
freaker87
Members-
Posts
51 -
Joined
-
Last visited
Never
Everything posted by freaker87
-
Hi all i have made php based program now i want to add a login system so there's any kind of simple, easy and free code available on any site which i can use thnx
-
use this in php $email( is a variable contain value of email field) if(!$email == "" && (!strstr($email,"@") || !strstr($email,"."))) { echo "<h2>Use Back - Enter valid e-mail</h2>\n"; $badinput = "<h2> NOT submitted</h2>\n"; echo $badinput; }
-
<?php echo '<tr> <th>other1</th> <th>other2</th> <th>other3</th> <th>other4</th> <th>other5</th> <th>other6</th> <th>M.no</th> <th>letter1</th> <th>letter2</th> <th>number1</th> <th>number1</th> <th>Qty</th> </tr>'; $qry = "select * from table"; $result= mysql_query($qry,$link); $nro=mysql_num_rows($result); while($row = mysql_fetch_array($result1)) { $other1 = $row['other1']; $other2 = $row['other2']; $other3 = $row['other3']; $other4 = $row['other4']; $other5 = $row['other5']; $other6 = $row['other6']; $mno = $row['mnubmer']; echo '<tr> <td>'.$other1.'</td> <td>'.$other2.'</td> <td>'.$other3.'</td> <td>'.$other4.'</td> <td>'.$other5.'</td> <td>'.$other6.'</td> <td>'.$mno.'</td>'; $qry1 = "select * from table1 where other1='$other1'"; $result1= mysql_query($qry1,$link); $nro1=mysql_num_rows($result1); $ccnt = 1; while($row1 = mysql_fetch_array($result1)) { $letter1 = $row1['letter1']; $letter2 = $row1['letter2']; $qty = $row1['quality']; if($ccnt == 1) { echo '<td>'.$letter1.'</td> <td>'.$letter2.'</td>'; } else { echo '<tr> <td>'." ".'</td> <td>'." ".'</td> <td>'." ".'</td> <td>'." ".'</td> <td>'." ".'</td> <td>'." ".'</td> <td>'." ".'</td> <td>'.$letter1.'</td> <td>'.$letter2.'</td>'; } $qry2 = "select * from table2 where other1='$other1'"; $result2= mysql_query($qry2,$link); $nro2=mysql_num_rows($result2); $row2 = mysql_fetch_array($result2); while($row2 = mysql_fetch_array($result1)) { $number1 = $row2['number1']; $number2 = $row2['number2']; echo '<td>'.$$number1.'</td> <td>'.$number2.'</td> <td>'.$$qty.'</td></tr>'; $ccnt = 0; } } } echo "</table>"; ?> and this is the accurate code i am using and accurate field name
-
use this... javascript code <script type="text/javascript"> function validateForm() { var x=document.forms["myForm"]["email"].value; var atpos=x.indexOf("@"); var dotpos=x.lastIndexOf("."); if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) { alert("Not a valid e-mail address"); return false; } } </script> this is html code.... <form name="myForm" action="demo_form.asp" onsubmit="return validateForm();" method="post"> Email: <input type="text" name="email"> <input type="submit" value="Submit"> </form>
-
i want to do this in css like a:hover or a:active
-
use this table.sample { border-width: 1px; border-spacing: 2px; border-style: outset; border-color: black; border-collapse: collapse background-color: white; font-weight: normal; color: black}
-
what is the css of active link like when somebody goes to ABOUT US page then about us color changed to red.... then going to CONTACT US page then about us color change to default and CONTACT US color change to red.... plz help i am new designer...... thnx
-
This is my code which i am trying & Psycho i've made my table like you did..... <?php echo '<tr> <th>other1</th> <th>other2</th> <th>other3</th> <th>other4</th> <th>other5</th> <th>other6</th> <th>M.no</th> <th>letter1</th> <th>letter2</th> <th>number1</th> <th>number1</th> <th>Qty</th> </tr>'; $qry = "select * from table"; $result= mysql_query($qry,$link); $nro=mysql_num_rows($result); while($row = mysql_fetch_array($result1)) { $other1 = $row['other1']; $other2 = $row['other2']; $other3 = $row['other3']; $other4 = $row['other4']; $other5 = $row['other5']; $other6 = $row['other6']; $mno = $row['mnubmer']; echo '<tr> <td>'.$other1.'</td> <td>'.$other2.'</td> <td>'.$other3.'</td> <td>'.$other4.'</td> <td>'.$other5.'</td> <td>'.$other6.'</td> <td>'.$mno.'</td>'; $qry1 = "select * from table1"; $result1= mysql_query($qry1,$link); $nro1=mysql_num_rows($result1); $ccnt = 1; while($row1 = mysql_fetch_array($result1)) { $letter1 = $row1['letter1']; $letter2 = $row1['letter2']; $qty = $row1['quality']; if($ccnt == 1) { echo '<td>'.$letter1.'</td> <td>'.$letter2.'</td>'; } else { echo '<tr> <td>'." ".'</td> <td>'." ".'</td> <td>'." ".'</td> <td>'." ".'</td> <td>'." ".'</td> <td>'." ".'</td> <td>'." ".'</td> <td>'.$letter1.'</td> <td>'.$letter2.'</td>'; } $qry2 = "select * from table2"; $result2= mysql_query($qry2,$link); $nro2=mysql_num_rows($result2); $row2 = mysql_fetch_array($result2); while($row2 = mysql_fetch_array($result1)) { $number1 = $row2['number1']; $number2 = $row2['number2']; echo '<td>'.$$number1.'</td> <td>'.$number2.'</td> <td>'.$$qty.'</td></tr>'; $ccnt = 0; } } } echo "</table>"; ?> Here is the image what i want to do.....
-
hi, i have mysql table like table1 table2 ----------------------- ------------------------ | A | B | | 1 | 2 | | C | D | | 3 | 4 | | E | F | ---------------------------- ------------------------ now i want to display them in html table cells(td)... like -------------------------------------------------------------------------------- A | B | 1 | 2 -------------------- C | D | 3 | 4 --------------------- E | F | ---------------------- ok i was trying this it in while looping but unable to do soo...........
-
Display multiple data from mysql table in one line?
freaker87 replied to freaker87's topic in PHP Coding Help
It works... Thanks Muddy..... -
Display multiple data from mysql table in one line?
freaker87 replied to freaker87's topic in PHP Coding Help
$qry = "select * from memaster"; $result = mysql_query($qry,$link); while ($row = mysql_fetch_array($result)) { $mid = $row['mid']; $mname = $row['mname']; } echo "<td> $mname</td>"; this is i am using...... -
i have a mysql table which contains name like mid mname 101 AAA 102 BBB 103 CCC now i have to print this name in a html table like AAA, BBB, CCC i am getting this by while loop in a variable but when loop changes then value also change so please tell me how i get this only in one variable & print
-
thnx but i use ............ add this line var str2 = <? echo $amt ?>; & xmlhttp.open("GET","getchemcom.php?q="+str+"&amt="+str2,true); now its workin fine... & thnx
-
i think i have to add something here xmlhttp.open("GET","getchemcom.php?q="+str,true);
-
how can i get value of $amt on another php page
-
I have this code function showprice(str)(str1) { if (str=="") { document.getElementById("txtchem").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtchem").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","getchemcom.php?q="+str,true); xmlhttp.send(); i use this <select onchange="showprice(this.value)($amt);" name='fid'> then in getchemcom.php file i get value by $val=$_GET["q"]; but its not working plz help me how can i pass $amt value in getchemcom.php page
-
I have this script and i want to take this in one variable & print where i want is this possible if ($nro > 0) { echo "<table id='gridview' align='center'> <tr> <td bgcolor='#99CC00'>E.T.D.</td> <td bgcolor='#99CC00'>E.T.A.</td> <td bgcolor='#99CC00'>Quantity</td> </tr>"; $totqty=0; while ($row=mysql_fetch_array($result)) { $etd = $row['etd']; $etd = GetDateUserFormat($etd); $eta = $row['eta']; $eta = GetDateUserFormat($eta); $qty = $row['shptqty']; echo "<tr>"; echo "<td>" . $etd . "</td>"; echo "<td>" . $eta . "</td>"; echo "<td>" . $qty . "</td>"; echo "</tr>"; $totqty = $totqty + $qty; } $remqty = $styleqty - $totqty; echo "<br>"; echo "<tr>"; echo "<td bgcolor='#99CC00' colspan='2'> Total Entered Quantity</td>"; echo "<td>" . $totqty . " Kg.</td>"; echo "<td bgcolor='#99CC00'> Remaining Quantity</td>"; echo "<td>" . $remqty . " Kg.</td>"; echo "</tr>"; echo "</table>"; }
-
I have two events which i want to call in select while onchange I am uing this but its not working........ <Select onchange="showsuppsch(this.value); showUser(this.value)">
-
Like this <?php require_once('includes/header.php'); ?> <script language="JavaScript" src="js/gen_validatorv4.js" type="text/javascript" xml:space="preserve"></script> <?php require_once('includes/nav.php'); ?> <div id="content"> <h3 align="center"> Add Supplier </h3> <div id="box-form"> <form name="suppadd" method="post" action=""> <div> <label>Supplier Name <strong>*</strong></label> <input name="txtsuppname" type="text" id="txtsuppname" size="50" maxlength="100" /> </div> <div> <label>Supplier Address <strong>*</strong></label> <textarea name="txtsuppadd" rows="5" cols="40" size="200"></textarea> </div> <div> <label>Supplier Phone</label> <input name="txtsuppphn" type="text" id="txtsuppphn" size="50" maxlength="20" /> </div> <div> <label>Supplier Email</label> <input name="txtsuppmail" type="text" id="txtsuppmail" size="50" maxlength="50" /> </div> <div> <label>Supplier Website</label> <input name="txtsuppweb" type="text" id="txtsuppweb" size="50" maxlength="50" /> </div> <div id="myform_errorloc" class="error_strings"></div> <div class="fbutton"> <input type="submit" value="Save" class="button" /> </div> </form> </div> <div style="clear: both;"> </div> </div> <!-- end #page --> <script language="JavaScript" type="text/javascript" xml:space="preserve"> var frmvalidator = new Validator("suppadd"); frmvalidator.EnableMsgsTogether(); frmvalidator.addValidation("txtsuppname","req","Enter Supplier Name!"); frmvalidator.addValidation("txtsuppadd","req","Enter Supplier Address!"); frmvalidator.addValidation("txtsuppmail","email","Enter valid Email!"); frmvalidator.addValidation("txtsuppadd","maxlen=250","Address Not More Than 250 Character!"); frmvalidator.addValidation("txtsupplogo","file_extn=jpg;jpeg;gif;png","Allowed files types are: jpg,gif,png"); </script> <?php require_once('includes/footer.php'); ?> <?php include("includes/connect.php"); include("functions/func.php"); mysql_select_db($Db, $link); $suppname = $_POST["txtsuppname"]; $suppadd = $_POST["txtsuppadd"]; $suppphn = $_POST["txtsuppphn"]; $suppmail = $_POST["txtsuppmail"]; $suppweb = $_POST["txtsuppweb"]; $query = "select * from suppmaster where suppname ='$suppname'"; $result= mysql_query($query,$link); $nro=mysql_num_rows($result); if($nro > 0) { include 'suppadd.php'; $msg = ("<script type='text/javascript'> window.alert('This Supplier is already exists!')</script>"); //header("Location:suppadd.php?msg=$msg"); exit(); } else { $nxtid = IncreaseIDbyOne(suppmaster,suppid,1001); $query = "INSERT INTO suppmaster (suppid,suppname,suppadd,suppphone,suppemail,suppwebsite,suppsys) values('$nxtid','$suppname','$suppadd','$suppphn','$suppmail','$suppweb','$suppsys')"; if(!mysql_query($query, $link)) die ("Mysql error ....<p>".mysql_error()); header("Refresh: 10; suppaddtest.php"); echo ("<script type='text/javascript'> window.alert('New Supplier added successfully with logo')</script>"); } ?> how can i validate form in php here
-
where should i start from, I am confused what i do?
-
can you give me some script
-
all information user can show in other page or same page which i haven't created yet First i've make it useful then i go beyond this and you can tell what is goig to be right...?
-
this is my suppadd.php file <?php require_once('includes/header.php'); ?> <?php require_once('includes/nav.php'); ?> <div id="content"> <h3 align="center"> Add Supplier </h3> <div id="box-form"> <form name="suppadd" method="post" action="suppsave.php"> <div> <label>Supplier Name <strong>*</strong></label> <input name="txtsuppname" type="text" id="txtsuppname" size="50" maxlength="100" /> </div> <div> <label>Supplier Address <strong>*</strong></label> <textarea name="txtsuppadd" rows="5" cols="40" size="200"></textarea> </div> <div> <label>Supplier Phone</label> <input name="txtsuppphn" type="text" id="txtsuppphn" size="50" maxlength="20" /> </div> <div> <label>Supplier Email</label> <input name="txtsuppmail" type="text" id="txtsuppmail" size="50" maxlength="50" /> </div> <div> <label>Supplier Website</label> <input name="txtsuppweb" type="text" id="txtsuppweb" size="50" maxlength="50" /> </div> <div> <input type="submit" value="Save" class="button" /> </div> </form> </div> <div align="right" style="margin-right:20px;"> <a href="view/supplistview.php" target="_blank">See All Supplier List</a> </div> <div style="clear: both;"> </div> </div> <!-- end #page --> <script language="JavaScript" type="text/javascript" xml:space="preserve"> var frmvalidator = new Validator("suppadd"); frmvalidator.EnableMsgsTogether(); frmvalidator.addValidation("txtsuppname","req","Enter Supplier Name!"); frmvalidator.addValidation("txtsuppadd","req","Enter Supplier Address!"); frmvalidator.addValidation("txtsuppsys","req","Enter Supplier System Id!"); frmvalidator.addValidation("txtsuppmail","email","Enter valid Email!"); frmvalidator.addValidation("txtsuppadd","maxlen=250","Address Not More Than 250 Character!"); </script> <?php require_once('includes/footer.php'); ?> & this is my suppsave.php file <?php include("includes/connect.php"); mysql_select_db($Db, $link); $suppname = $_POST["txtsuppname"]; $suppadd = $_POST["txtsuppadd"]; $suppphn = $_POST["txtsuppphn"]; $suppmail = $_POST["txtsuppmail"]; $suppweb = $_POST["txtsuppweb"]; $query = "select * from suppmaster where suppname ='$suppname'"; $result= mysql_query($query,$link); $nro=mysql_num_rows($result); if($nro > 0) { include 'suppadd.php'; $msg = ("<script type='text/javascript'> window.alert('This Supplier is already exists!')</script>"); //header("Location:suppadd.php?msg=$msg"); exit(); } else { $query = "INSERT INTO suppmaster (suppname,suppadd,suppphone,suppemail,suppwebsite,suppsys) values($suppname','$suppadd','$suppphn','$suppmail','$suppweb','$suppsys')"; include 'suppadd.php'; echo ("<script type='text/javascript'> window.alert('New Supplier added successfully')</script>"); } ?>
-
Yes I tried your code its work but its gettin my form errors like enter supplier name.../
-
No Its not usable it refresh the page & getting my forms error which i am using for users like (Please fill all Fields) I also googleit & find something this $msg = ("<script type='text/javascript'> window.alert('New Supplier Added successfully!')</script>"); header("Location:suppadd.php?msg=$msg"); & I've used this but it doesnt do anything check if you could do something to make it useful...