hello..
i mean echo $filename; means check that image path for your current working directory...
R0bb0b commented: That's a good definition +2
OmniX commented: Very useful and informative information. +1
hello..
i mean echo $filename; means check that image path for your current working directory...
going to learn about implode and explode functions clearly...and also coding.....
Do something to get great thing,Because something you have......
post your updated code...
<?php echo "<img src='/images/". $filename ."'>" ?>
in this line the / before the images,Is is must???i think no..
And also make sure that is correct path of your current folder to images folder...
or echo $filename; check it with correct path of stored image..
or post your appropriate code..
i will check it..
Doing shopping cart with sessions is best way to load our site fastly than storing them into a database table..But its must to store ordered data finally in database table for future reference of orders ,order user details and status of order...
In my way, i hope the best method is-
creating one session array for one user session and storing all the data like product_id,price,quantity,user details etc ..And update that session array between that user shopping navigations..and finally storing the session data into a table...
if this is not your requirement..let me know...
A programmer , who is coding the particular job ,which already designed. A developer developes the whole thing from analysing, then designing,code it and then test the same.
For instance, a user selects American Bantam and the years 1936, 1937... 1940, 1941 are listed.
If user selects name, then based on that id you can get two dates from your database table, then make a dropdown list by incrementing the first date, put if condition greater than end date...
try it...
or post appropriate code...then we can see it for validate....
why not communities .....
Form where $result_row comes from???
i thinks its $rowsql...
i hope so....check it...
i tried your code ...
i didn't get that error...its work fine...
check again..
hello check this attachment below..
go through your database....
<?
$bnblink = mysql_connect('localhost', 'root', '1234') ;
mysql_select_db('mydb');
?>
<html>
<head>
<title>Selecting yaarr...</title>
<script language="javascript">
function change()
{
if(document.form1.state.value=="")
{
alert("Please Select State");
document.form1.state.focus();
return false;
}
else if(document.form1.city.value=="")
{
alert("Please Select City");
document.form1.city.focus();
return false;
}
window.location='selectplace1table.php?stateid='+document.form1.state.value+'&cityid='+document.form1.city.value;
}
</script>
</head>
<body>
<?
$res_c=mysql_query("select * from onetable");
echo "<script language=javascript>\n";
echo "function chgitems1()\n";
echo "{\n";
echo "var d=document.form1;\n";
echo "if(d.state.value==0)\n";
echo "{\n";
echo "d.city.options.length = 0;\n";
echo "d.city.options[0]=new Option(\"Select City\",\"\")\n";
echo "}\n";
while($row_c=mysql_fetch_array($res_c,MYSQL_BOTH))
{
echo "if(d.state.value==".$row_c['id'].")\n";
echo "{\n";
echo "d.city.length=0;\n";
$sub_res=mysql_query("SELECT * from onetable where pid=".$row_c['id']." order by name");
$i=1;
echo "d.city.options[0]=new Option(\"Select City\",\"\")\n";
while($sub_row=mysql_fetch_array($sub_res,MYSQL_BOTH))
{
echo "d.city.options[".$i."]=new Option('".$sub_row['name']."','".$sub_row['id']."');\n";
$i=$i+1;
}
echo "}\n";
}
echo "}";
echo "function chgitems2()\n";
echo "{\n";
echo "var p=document.form1;\n";
echo "if(p.city.value==0)\n";
echo "{\n";
echo "p.place.options.length = 0;\n";
echo "p.place.options[0]=new Option(\"Select Place\",\"\")\n";
echo "}\n";
$res_c=mysql_query("select * from onetable");
while($row_p=mysql_fetch_array($res_c,MYSQL_BOTH)){
echo "if(p.city.value==".$row_p['id'].")\n";
echo "{\n";
echo "p.place.length=0;\n";
$sub_res=mysql_query("SELECT * from onetable where pid=".$row_p['id']." order by name");
$i=1;
echo "p.place.options[0]=new Option(\"Select Place\",\"\")\n";
while($sub_row=mysql_fetch_array($sub_res,MYSQL_BOTH)){
echo "p.place.options[".$i."]=new Option('".$sub_row['name']."','".$sub_row['id']."');\n";
$i=$i+1;
}
echo "}\n";
}
echo "}";
echo "</script>\n";
?>
<tr><td>
<table width="90%" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td valign="top" bgcolor="#010E33"><table width="100%" border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF">
<tr align="center">
<td colspan="3"> </td>
</tr>
<tr align="center">
<td colspan="3"><form action="" method="post" name="form1">
<table width="70%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="46%" align="right"><span class="mtext5">Select State</span> </td>
<td width="2%" align="center" class="mtext5">:</td>
<td width="52%"><select name="state" class="input_form" style="width:150" onChange="chgitems1();">
<option value="" selected>Select State</option>
<?
/*$state=$_POST['state1']; */
$query1=mysql_query("SELECT * FROM onetable where pid='0'");
$cnt=mysql_num_rows($query1);
if($cnt>0)
{
while($list1=mysql_fetch_array($query1))
{
echo "<option value='$list1[id]' >$list1[name]</option>";
}
}
?>
</select></td>
</tr>
<tr>
<td width="46%" align="right" class="mtext5"><span class="mtext5">Select City</span> </td>
<td width="2%" align="center" class="mtext5">:</td>
<td width="52%"><select name="city" class="input_form" style="width:150" onChange="chgitems2();">
<option value="" selected>Select City</option>
<? if(!empty($_GET['stateid']) )
{
/*?>getcity($_GET['stateid'],$_GET['cityid'])
{<?php */
$query1=mysql_query("SELECT * FROM onetable where pid='".$_GET['stateid']."'");
$cnt=mysql_num_rows($query1);
if($cnt>0)
{
while($list1=mysql_fetch_array($query1))
{
echo "<option value='$list1[id]' >$list1[name]</option>";
}
}
}
?>
</select> </td>
</tr>
<tr><td width="46" align="center">
</td></tr>
<tr>
<td width="46%" align="right" class="mtext5"><span class="mtext5">Select Place</span> </td>
<td width="2%" align="center" class="mtext5">:</td>
<td width="52%"><select name="place" class="input_form" style="width:150" onChange="return change(this)">
<option value="" selected>Select Place</option>
<? if(!empty($_GET['stateid']) && !empty($_GET['cityid']))
{
/*?>getcity($_GET['stateid'],$_GET['cityid'])
{<?php */
$query1=mysql_query("SELECT * FROM onetable where pid='".$_GET['cityid']."'");
$cnt=mysql_num_rows($query1);
if($cnt>0)
{
while($list1=mysql_fetch_array($query1))
{
echo "<option value='$list1[id]' >$list1[name]</option>";
}
}
}
?>
</select></td>
</tr>
<tr><td width="46" align="center">
</td></tr>
</table>
</form></td></tr>
</table>
</td></tr>
</body>
</html>
see this:
$variable="a";
$sql = "select * from characters where letters like '%".$variable."%'";
A child on a farm sees a plane fly by overhead and dreams of a far way place....
A traveler on the plane sees the farm and dreams of home....that life...
hello try this:
$sql = "select * from characters where letters like '%a%'";
$query = mysql_query($sql);
$count=mysql_num_rows($query);
echo $count;
Hello alll...
today i learned difference between using css or table based..as i know some information on this...i just knew more points by this thread:
http://www.daniweb.com/forums/thread150866.html
and also
http://www.templatesfactory.net/articles/css-vs-table-based-design.html
Adding to David_ ...
i added some more points here...
this link will give more points on this...
http://www.chromaticsites.com/web-design-blog/2008-04-03/13-reasons-why-css-is-superior-to-tables-in-website-design/
hello mrcniceguy ..
i have checked your code...
i think you just end your if condition brace at that line only...
means like..
if(isset($_GET['userid']))
{
$userid=$_GET['userid'];
}
other wise it will take that userid again and it will fetch and it will display first image...
try this way..you will definatly get your requirement..
yes , try PoA way like:
$seq="select count(*) as cnt fromdata_table WHERE page='$page'";
$sres=mysql_query($seq);
$srow=mysql_fetch_assoc($sres);
if($srow['cnt']>7) {
//do something}
else if($srow['cnt']<=7)
{
//do another thing
}
or check for main fields of that post form...then i can be prevented...
for example...
$seq="select count(*) as cnt from tablename where username='".$_POST['username']."'";
sres=mysql_query($seq);
$srow=mysql_fetch_assoc($sres);
if($srow['cnt']>0) {
$errmsg="User with this Username already existed.";
} else
{
//do your insert operations..
}
and for empty fields doing client side validation is better...
Thought for life time:::
The most time you will have to spend in your life is with yourself...So make yourself as interesting as possible....
Have A Great Day for all Daniweb Family Members...
i think no difference between them....
Any information on this???
get report id from where ever you display the view in your page...
HELLO all...
Good Afternoon!!!!
Currently i am developing a website...In that website i want to ad management ,where we can add and manage different ads with different prices, in different place on our website with time and etc...
Any body have any scripts or any ideas to develop this kind...
or any open source scripts available ...
Please Let Me know..
Thank you,
Shanti.
today i learned that thinking :-/ is such a waste of time because it took 2 hours to me thinking what to do next after watching ajax tutorials videos
Some times thinking will result in good ideas even they took more time...
And start practice on ajax programming..Its very interesting..
Go ahead my dear kid....
today i learned and wrote myself with little piece of code upon practicing the session arrays...
here my little code goes:
<?
session_start();
if($_SERVER['REQUEST_METHOD']=='POST')
{
foreach($_POST['checkbox'] as $key=>$val){
echo "key: ". $key. " value: ". $val ."<br />\n";
session_register();
//$_SESSION['checked'] = array();
}
$_SESSION['checked']=$_POST['checkbox'];
foreach ($_SESSION['checked'] as $key=>$value) {
echo 'The value of $_SESSION['."'".$key."'".'] is '."'".$value."'".' <br />';
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<form action="" method="post" name="form1">
<table width="100%" border="0">
<tr>
<td><input type="checkbox" name="checkbox[]" value="1">
<input type="checkbox" name="checkbox[]" value="2">
<input type="checkbox" name="checkbox[]" value="3">
<input type="checkbox" name="checkbox[]" value="4">
<input type="checkbox" name="checkbox[]" value="5"> </td>
</tr>
<tr>
<td><input type="submit" name="button" value="GO!">
</td>
</tr>
</table>
</form>
</body>
</html>
just had tasty indian lunch...
There is no wrong time to do a right thing!!!!
see this code...it will print only clicked checkboxes..
foreach($_POST['checkbox'] as $key=>$val){
echo "key: ". $key. " value: ". $val ."<br />\n";
echo $_POST['checkbox'][0];
and this is for storing in sessions:
session_start();
if($_SERVER['REQUEST_METHOD']=='POST')
{
foreach($_POST['checkbox'] as $key=>$val){
echo "key: ". $key. " value: ". $val ."<br />\n";
session_register();
//$_SESSION['checked'] = array();
}
$_SESSION['checked']=$_POST['checkbox'];
foreach ($_SESSION['checked'] as $key=>$value) {
echo 'The value of $_SESSION['."'".$key."'".'] is '."'".$value."'".' <br />';
}
}
use this line instead of return true in your js code:
theform.action="anotherpage.php";
try this code:
$qry=mysql_query("SELECT * FROM yourtablename ");
$num=mysql_num_rows($qry);
$start=0;
$len=1000;
$value=$_POST['field']
while($start<$num)
{
$f="update tablename set field='".$value."' LIMIT $start,$len";
$start=$start+1000;
$len=$len+1000;
}
or try this:
SELECT t1.Name, SUM(t1.Salary + t2.Bonus) as Total From tb1 as t1, tb2 as t2 WHERE t1.Name = t2.Name group by t1.Name order by t1.Salary
hello try this:
<?
if($_SERVER['REQUEST_METHOD']=='POST')
{
$qry1="SELECT * FROM yourtablename WHERE correct_answer='".$_POST['ans']."'";
$res1=mysql_query($qry1) or die(mysql_error());
$num1=mysql_num_rows($res1);
if($num1==1)
{
echo "correct answer";
}
else
{
echo "wrong answer!!";
}
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?
$qry="SELECT * FROM yourtablename ";
$res=mysql_query($qry1) or die(mysql_error());
$result=mysql_fetch_array($res);
?>
<form action="" method="post" name="form1">
<table width="100%" border="0">
<tr>
<td>1.When of the following is NOT used to test an expression?</td>
</tr>
<tr>
<td><label>
<input name="ans" type="radio" value="<?=$result['question1']?>" />
</label>
A. if ()else statement</td>
</tr>
<tr>
<td><input name="ans" type="radio" value="<?=$result['question1']?>" />
B. is_double()</td>
</tr>
<tr>
<td><input name="ans" type="radio" value="<?=$result['question1']?>" />
C. x=y</td>
</tr>
<tr>
<td><input name="isset()" type="radio" value="<?=$result['question1']?>" />
D. isset()</td>
</tr>
</table>
</form>
</body>
</html>
try this:
$t=mysql_query("select * from headlines");
$result=mysql_fetch_array($t);
$r=mysql_query("select c as count(*) from comments where hidofctbl='".$result['hid']."'");
AVG(Votes) is exactly what you want......
use this code:
<a href="javascript:;" onClick="window.open('yourpage.php?id=<?=$row['reportid'];?>','no','scrollbars=yes,width=600,height=550')" >View</a>
you can use this code when you have used sessions in your login page...
use this code at your logout page:
session_unregister('username');
session_destroy();
try this:
echo $r1="SELECT assignment.Candidate, assignment.Chaplain, assignment.Reader, assignment.Id, tbl_user.Id, tbl_user.name_pre, tbl_user.name_first, tbl_user.name_last
FROM assignment, tbl_user
WHERE assignment.Id=tbl_user.Id
ORDER BY assignment.Candidate ASC"
$r=mysql_query($r1);
And make sure that query is correct...
hello..
try this code:
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Third Santor</title>
<script>
function generate(){
var myDiv = document.getElementById('someid');
var objTextArea = document.getElementById('mem1');
var list = objTextArea.value.split('\n');
var tbody = document.createElement('tbody');
for(var i=0; i<list.length; i++){
var cell1 = document.createElement('td');
var label = document.createTextNode(list[i]);
cell1.appendChild(label);
var cell2 = document.createElement('td');
var textbox = document.createElement('input');
textbox.type = 'text';
textbox.id = list[i];
cell1.appendChild(textbox);
var row = document.createElement('tr');
row.appendChild(cell1);
row.appendChild(cell2);
tbody.appendChild(row);
}
var table = document.createElement('table');
table.border = 1;
table.appendChild(tbody);
/* var submit = document.createElement('input');
submit.type = 'submit';
submit.value = 'Submit';
*/
myDiv.appendChild(table);
myDiv.appendChild(submit);
}
</script>
</head>
<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
<form name="frm1" method="post" action="" onsubmit="return ">
<textarea name="mem1" id="mem1" rows="10" cols="30"></textarea>
<input type="button" value="Generate" onclick="generate();">
</form>
<DIV id="someid"></DIV>
</body>
</html>
and also check:
http://www.daniweb.com/forums/thread135356.html
You are Welcome!!!!!!
hello..
that is CAPTCHA ..means creating dynamic number on an image...
It is used to prevent spam abuse on the websites
For more information:
http://www.webcheatsheet.com/PHP/create_captcha_protection.php
you mean dynamic text box generation...
or
what do you mean by fields here?