- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
15 Posted Topics
Try this code.... [CODE] //select.php <html> <body bgcolor="pink"> <? $con=mysql_connect("localhost","root","root"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("test", $con); $result=mysql_query("select * from student"); echo "<table border='3'> <tr> <th >Firstname</th> <th>Lastname</th> <th> Age</th> <th>Update</th> </tr>"; if(mysql_num_rows($result) > 0) { while($row=mysql_fetch_assoc($result)) { echo "<tr>"; echo "<td>" . $row['FirstName'] . …
Try this.... [CODE] <object type="application/x-shockwave-flash" style="width:470px;height:320px;" data="http://www.example.com/swf/<?php echo $_GET['code']; ?>"> <param name="movie" value="http://www.example.com/swf/<?php echo $_GET['code']; ?>" /> <param name="quality" value="very high" /> <param name="wmode" value="transparent" /> <param name="bgcolor" value="" /> <param name="autoplay" value="true" /> <param name="allownetworking" value="internal" /> <param name="allowfullscreen" value="true" /> <param name="allowscriptaccess" value="always" /> </object> [/CODE] OR [CODE] …
This is just a Notice. It's just saying that $bar is not defined anywhere, which isn't a very bad problem unless maybe you have register_globals on. Soln.. 1. Turn off notices in php.ini OR 2. Include this code at the header of page. [CODE] <?php // Turn off all error …
Try this... [CODE] $comma = ""; foreach ($_POST as $key=>$value){ if ($key != "submit" && $key != "type"){ $fields = $comma.$key; echo $fields; $comma = ","; } } [/CODE]
1. You can not write double quotes (") inside a double quote. Correct code is... printf("<tr><td><a href=\"#\">%u</a></td><td></td><td>%s</td><td>%s</td></tr>",$r[ "Artikelnummer"], $r["Artikelmerk"], $r["Artikelnaam"]); OR printf("<tr><td><a href='#'>%u</a></td><td></td><td>%s</td><td>%s</td></tr>",$r[ "Artikelnummer"], $r["Artikelmerk"], $r["Artikelnaam"]); 2. To make link and display corresponding data just write code as ... <?php $result = mysql_query("SELECT url,Artikelnummer, Artikelmerk, Artikelnaam FROM Product ORDER BY …
[icode] $qry="SELECT id, member, math, bathmos FROM bathmoi"; $handle=mysql_query($qry); echo '<textarea name="show" rows="20" cols="70" readonly="readonly">'; if(mysql_num_rows($handle) > 0) { while($result = mysql_fetch_array($handle)) { echo "$result[id], $resuld[memeber], $result[mathima]"; } } echo "</textarea>"; [/icode] also it is not a good practice to allow user to delete records through a text box, the …
use the function eregi_replace(); eregi_replace ( string $pattern , string $replacement , string $string )
[code] <?php function isImage($fileName) { $ext = substr(strrchr($fileName, '.'), 1); if($ext <> "") { $ext = strtolower($ext); switch($ext) { case 'gif': return true; case 'jpeg': return true; case 'png': return true; case 'psd': return true; case 'bmp': return true; case 'tiff': return true; case 'jp2': return true; case 'iff': return …
[code] <html> <head> <script language="JavaScript"> function make_textbox(no) { if(no < 1) return false; var my_textbox = ""; for(var i=0;i<no;i++) { my_textbox += "<br>Text Box "+eval(i+1)+": <input type='text' name='textfield["+i+"]'>"; } document.getElementById("text_id").innerHTML = my_textbox; } </script> </head> <body> <form name="myfrm"> Select Number Of TextBox : <select name="select_num_text" onChange="JavaScript:make_textbox(this.value);"> <option value="">Select</option> <?php for($i=3;$i<=40;$i++) …
[icode] <?php function isImage($fileName) { $ext = substr(strrchr($fileName, '.'), 1); if($ext <> "") { $ext = strtolower($ext); switch($ext) { case 'gif': return true; case 'jpeg': return true; case 'png': return true; case 'psd': return true; case 'bmp': return true; case 'tiff': return true; case 'jp2': return true; case 'iff': return …
[code=syntax] $service = $_POST['service']; if(is_array($service)) { $comma = ""; $service_type = ""; foreach($service as $value) { $service_type .= $comma.$value; $comma = ", "; } $message .= "Type of Service needed:" .$service_type . "\n"; } [/code] Same for other check boxes...
Aamit, If condition will be "if($num>0)"
[code=php]<html> <body> <?php $display_form = true; if($_POST['submit']=="Submit") { if(trim($_POST['my_text'])=="") { $error = "Please fill text box"; } else { echo ' <form name="my_form" id="my_form" method="POST" action="submit.php"> <input type="hidden" name="my_text" value="'.$_POST['my_text'].'"> </form> <script language="JavaScript"> function form_submit() { var my_frm = document.getElementById("my_form"); my_frm.submit(); } window.onload=form_submit; </script>'; $display_form = false; } }//EO if($_POST['submit']=="Submit") …
The End.