vibhaJ 126 Master Poster

I have checked with test name.txt and it works fine in my browser.
and if i give only google.com in my href it won't work.

You don't have to have http:// in the href.

The space shouldn't be there. Filenames should not have spaces in them. I'd go at it to change them - change them from space to underscore or similar.

vibhaJ 126 Master Poster

I think its not because of space.
Your href link must start with http:// to work in browser.
When you click on link what is url shown in browser?

vibhaJ 126 Master Poster

1. session_start(); must be on the first line of coding.
2. where is $_SESSION defined?
3. you have to check user's entered code with session captcha code on add_enquiry.php page.
Because your form action is 'add_enquiry.php' which will directly executed code without checking captcha.

vibhaJ 126 Master Poster

Yup.. you are absolutely correct.

I am not sure if you are aware of jquery.
with the help of jquey java script code is so much simplified.

e.g.lets you want to show or hide a div id 'myDivd'.
In jquery it is a simple one line coding.

$('#myDivd').show();
$('#myDivd').hide();

Here is a link:
http://api.jquery.com/show/

There are plenty of functionality available in jquery.
This is just a knowledge sharing as you are newbie.

vibhaJ 126 Master Poster

Okay.. as a beginner always try to explore as many way as you can for any development.And use the best one.So if you stuck anywhere you have another choice. e.g. form submission can be done more than one way.

I have seen your solution.Its 100% right but here's a just suggestion.

Lets say if you have changed your html code in field id :'to_change_into_image'.
In your way you have to change it twice. once in html and once in javascript.
You also have to take care of back slash '\'.(I hate concatenation of strings in javascript as it breaks sometime :) ) And if a little quote or slash is missing whole JS will not work.So i prefer not to use it.

vibhaJ 126 Master Poster
<?php
// the HTML source of a URL.
$lines = file('http://www.google.com/');

// Loop through our array, show HTML source as HTML source; and line numbers too.
foreach ($lines as $line_num => $line) {
    echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
}
?>
vibhaJ 126 Master Poster

You can design your database this manner:

commentId| parentCommentId |user |comment
1		 |	0			   |XYZ  |hsdahfkasydf astdfsa dftasdf astdfasdf
2		 |	1			   |TYU  |why you writing wirdo?
3		 |	1			   |IOP  |wtf!
4		 |	0			   |VBN  |I love daniweb.
5		 |	4			   |DFG  |me too.
vibhaJ 126 Master Poster

- you can not define function in another function.
- always keep practice to return value from any function.

<script language="javascript">
function check()
{
	if(confirm("Are you sure you want to place your order?"))
	{
		var a= document.myForm.name.value;
		var b= document.myForm.phoneNumber.value;
		var c= document.myForm.unitNumber.value;
		var d= document.myForm.streetName.value;
		var e= document.myForm.city.value;
		var f= document.myForm.zip.value;
		var g= document.myForm.province.value;
		if( a =="" || b=="" || c=="" || d=="" || e=="" || f=="" || g=="")
		{
			alert("Input fields can not be empty");
			return false;
		}
		else
			return true;
	}
	else
	{
		return false;
	}
} 
</script>
vibhaJ 126 Master Poster
<?php
$subject = "<a href='google.com'>Google link</a>";
$pattern = "/url|link|href/";

preg_match($pattern, substr($subject,3), $matches, PREG_OFFSET_CAPTURE);
print_r($matches);
?>
vibhaJ 126 Master Poster

Why don't you toggle both layout.
Here is code for that.

<script language="javascript">
function changeText()
{
	document.getElementById('layout1').style.display = 'none';
	document.getElementById('layout2').style.display = 'block';
}
function resetText()
{
	document.getElementById('layout2').style.display = 'none';
	document.getElementById('layout1').style.display = 'block';
}
</script>
<div id="to_change_into_image" class="box">
<div id="layout1">
<h1>Table for layout</h1>
<table class="table_for_layout"><!--OUTER TABLE-->
<tbody><tr>
<td></td><td colspan="2"><p><br></p><h2>Web editing - Tables</h2></td>
</tr>
<tr><td>
<table class="inner_table"><!--INNER TABLE SITS IN THE COLUMN OF THE OUTER TABLE-->

<tbody><tr>
<td><a href="styles.htm">Styles</a></td>
</tr>
<tr>
<td><a href="documents.htm">Documents</a></td>
</tr>
<tr>
<td><a href="content.htm">Content</a></td>
</tr>
<tr>
<td><a href="links.htm">Links</a></td>
</tr>
<tr>
<td><a href="Images">Images</a></td>
</tr>
<tr>
<td>Pages</td>
</tr>
<tr>
<td><strong>Tables</strong></td>
</tr>
</tbody></table><!--INNER TABLE--></td>
<!--SECOND COLUMN OF INNER TABLE TAKES THE TEXT -->
<td colspan="2"><h3>Tables in the page</h3>
<p>Nowadays tables are used only for tabular data and not for layout purposes. To arrage text and elements in a page we use a CSS like this - that's the CSS for this website.</p></td>

</tr></tbody></table>
</div>
<div id="layout2" style="display:none;">
<img src="table_for_layout_2.jpg">
</div>
</div>
vibhaJ 126 Master Poster
function check()
{
  var a = document.getElementById('name').value;
  var b = document.getElementById('address').value;
  if( a =="" || b==""){
     alert("Input fields can not be empty");
     return false;
  }
return true;
}

Where name and address is id of the fields.

vibhaJ 126 Master Poster

You can get query string parameter using $_GET.

echo '<pre>';
print_r($_GET);
vibhaJ 126 Master Poster

below is code.
with the help of in_array function.

<?
	$childarr = explode(",", $row["children_pref"]);	
?>
<input type="checkbox" name="children_pref[]" value="0" <?=(in_array('0',$childarr))?('checked'):('');?> >None<br>
<input type="checkbox" name="children_pref[]" value="1" <?=(in_array('1',$childarr))?('checked'):('');?>> 1<br>
<input type="checkbox" name="children_pref[]" value="2" <?=(in_array('2',$childarr))?('checked'):('');?>> 2<br>
<input type="checkbox" name="children_pref[]" value="3" <?=(in_array('3',$childarr))?('checked'):('');?>> 3<br>
<input type="checkbox" name="children_pref[]" value="4" <?=(in_array('4',$childarr))?('checked'):('');?>> 4<br>
<input type="checkbox" name="children_pref[]" value="5" <?=(in_array('5',$childarr))?('checked'):('');?>> 5<br>
<input type="checkbox" name="children_pref[]" value="6" <?=(in_array('6',$childarr))?('checked'):('');?>> 6 or more<br>
vibhaJ 126 Master Poster

I use this code found from one forum.
Hope this helps you.

<?php
if (!isset($_POST["timezoneoffset"])){
?>
 <form method="post" action="<?php echo $_SERVER["PHP_SELF"];  ?>" id="time_form" name="time_form">
 <script type="text/javascript">
  tzo = - new Date().getTimezoneOffset()*60;
  document.write('<input type="hidden" value="'+tzo+'" name="timezoneoffset">');
 </script>
 <input type="submit" value="Get Server Client TimeZone Difference" name="Ok">
 </form>
<?php
}else{
 $serverTimezoneOffset = (date("O") / 100 * 60 * 60);
 echo 'Server Timezone Offset : ' . ($serverTimezoneOffset/(60*60)) .' hours';
 echo '<br />';
 $clientTimezoneOffset = $_POST["timezoneoffset"];
 echo 'Client Timezone Offset : ' . ($clientTimezoneOffset/(60*60)) .' hours';
 echo '<br />';
 $serverTime = time();
 echo 'Server date time : ' . strftime("%d %b %Y %H:%M", $serverTime);
 echo '<br />';
 $serverClientTimeDifference = $clientTimezoneOffset-$serverTimezoneOffset;
 $clientTime = $serverTime+$serverClientTimeDifference;
 echo 'Client date time : ' . strftime("%d %b %Y %H:%M", $clientTime);
 echo '<br />';
 echo 'Difference : ' . ($serverClientTimeDifference/(60*60)) . " hours";
 echo '<br />';
}
?>
vibhaJ 126 Master Poster

This code return array of emails.

<?
	$str = '"ceo@facekut.com" <ceo@facekut.com>,"Rahul Mahajan" <creative.rahul007@gmail.com>';
	$pattern = '/<([^"]*)>/';
	preg_match_all($pattern, $str, $matches, PREG_OFFSET_CAPTURE, 3);	
	foreach($matches[1] as $val)
	{
		foreach($val as $key=>$each)
		{
			if($key==0)
				$email[]=$each;
		}
	}
	print_r($email);
	
	
?>
dalip_007 commented: Vibha is exceptionally excellent. +2
vibhaJ 126 Master Poster
$("#idtext").change(function(){			
		$('.alltr').hide();		
		$('div[id*="'+$("#idtext").val()+'"]').show();	
});

I think this should work.

vibhaJ 126 Master Poster

Give class 'alltr' to all tr.
And then try below code.

$("#idtext").change(function(){			
		$('.alltr').hide();		
		$('#'+$("#idtext").val()).show();		
});
vibhaJ 126 Master Poster

Here is your query.

SELECT name,SUBSTRING(name,1,LOCATE('_',name)-1) FROM `student`
vibhaJ 126 Master Poster

Why don't you try php code.

<?
	$temp = explode('_', $option);
	unset($temp[count($temp)]);
	$option = implode('_', $temp);	
?>
vibhaJ 126 Master Poster

Hi,
First of all you need email access information of accounts you want to grab.
It can be done using PHP IMAP.
Check this link
Once you have emails in php variables insert into your mysql database.
Hope this helps.

GreaseJunkie commented: Dead-on response to my needs! +1
vibhaJ 126 Master Poster

Here i have written complete code.
Try it, its easy to understand.

<?
	mysql_connect('localhost','root','');
	mysql_select_db('test');	
	
	if(isset($_REQUEST['delete']))
	{
		$deleteCb = $_REQUEST['deleteCb'];
		for($i=0;$i<count($deleteCb);$i++)
		{
			$news_id = $deleteCb[$i];
			$q = "delete from newslist where news_id= ".$news_id;
			mysql_query($q);		
		}
		header("location:test.php");
		exit;
	}
?>
<form name="form" id="form" method="post">
<table width="400" border="1" cellspacing="0" cellpadding="0">
<?
	$q="select * from newslist";
	$rs = mysql_query($q);		
	if(mysql_num_rows($rs))
	{
?>
	<tr>
		<td>Delete</td>
		<td>Title</td>
	</tr>
<?
	while($sar = mysql_fetch_assoc($rs))
	{
?>	
	<tr>
		<td><input name="deleteCb[]" type="checkbox" value="<?=$sar['news_id'];?>" /></td>
		<td><?=$sar['title'];?></td>
	</tr>
<? } ?>
	<tr>
		<td><input name="delete" value="Delete Selected" type="submit" /></td>
		<td>&nbsp;</td>
	</tr>	
<?	}
	else
	{
?>
	<tr>
		<td></td>
		<td>No result found</td>
	</tr>
<? } ?>		
</table>
</form>
vibhaJ 126 Master Poster

Don't call user_login function in login.php.
Just remove function user_login from all.
I think you can not redirect within a php function like this so avoid it.

vibhaJ 126 Master Poster

Why are you usign function for login?
You can direct do below:

<?php session_start(); 
mysql_connect("localhost", "dbuser", "dbpassword"); 
mysql_select_db("myDB");

if (isset($_POST['username']) && isset($_POST['pword']))
{
	
	$username = mysql_real_escape_string($_POST['username']); 
	$password = md5( mysql_real_escape_string($_POST['pword']) );
	$sql = mysql_query("SELECT * FROM usersystem WHERE username = '$username' AND password = '$password' LIMIT 1"); 
	$rows = mysql_num_rows($sql); 
	
	if ($rows<1)
	{ 
	echo "&serverResponse=Incorrect username/password"; 
	}
	else 
	{
	$result = mysql_query("SELECT total FROM usersystem WHERE username = '$username'") or die( mysql_error() );
	$row=mysql_fetch_assoc($result);
	$total = $row['total'];
	header( "Location: play.php" ) ;
	setcookie("username", "$username", time()+3600);
	setcookie("total", "$total", time()+3600);
	$_SESSION['username'] = $username;
	
	
	} 
}
?>

Reason for checking play.php is below:
Sometimes it happens that you have successfully login but in your protected page say play.page session is not set because of any reason, then even user is rediretd to play.php he is again thrown to login page.
I have this scenario in past so i asked you to check.

vibhaJ 126 Master Poster

Also try below debugging.
echo "SELECT * FROM usersystem WHERE username = '$username' AND password = '$password' LIMIT 1"; exit;
Run that output in phpmyadmin sql tab. Just crosscheck query returns result.

vibhaJ 126 Master Poster

so issue is with play.php page.Post its code here.

And also try print_r($_SESSION); exit; after session _start(); function on play.php.Which will show sessions available on that page.

vibhaJ 126 Master Poster

You mean user is not redirected to play.php even he is valid user?

<?
{
$username = mysql_real_escape_string($username); 
$password = md5( mysql_real_escape_string($password) );
$sql = mysql_query("SELECT * FROM usersystem WHERE username = '$username' AND password = '$password' LIMIT 1"); 
$rows = mysql_num_rows($sql); 

	if ($rows<1)
	{ 
		echo "&serverResponse=Incorrect username/password"; 
	}
	else 
	{
		setcookie("username", "$username", time()+3600);
		$result = mysql_query("SELECT total FROM usersystem WHERE username = '$username'") or die( mysql_error() );
		$row=mysql_fetch_assoc($result);
		$total = $row['total'];
		setcookie("total", "$total", time()+3600);
		$_SESSION['username'] = $username;
		
		header( "Location: play.php" ) ;
		exit;
	} 
}
?>

Add echo 'hi';exit; in first line of play.php. Post your output.

vibhaJ 126 Master Poster

If you get the logic for month then exact same way you can do for year also,
in sql query use YEAR function this is example.

vibhaJ 126 Master Poster

Run below query in phpmyadmin sql tab and post output here.
SELECT monthname(local_date) as month FROM tbl_localnews

vibhaJ 126 Master Poster

OOpss..
u_reg_date field is from my testind end, it should be local_date for you.

change

$result = mysql_query("SELECT distinct monthname(u_reg_date) as month FROM tbl_localnews");

to

$result = mysql_query("SELECT distinct monthname(local_date) as month FROM tbl_localnews");
vibhaJ 126 Master Poster

Have you read this :

monthname(u_reg_date) directly gives you month name from database so you dont have to do date('F',strtotime($row))

check this for monthname detail.

for $row, month is not table field but it is alias created for monthname(local_date). I wonder u have not used 'AS' in sql query.

For error, use mysql_num_rows function as shown below whenever you use mysql_fetch_array.

if(mysql_num_rows($result))
	{
		while ($row = mysql_fetch_array($result)) 
		{			
			//.... whatever code....
		}
	}

Post ur result.

vibhaJ 126 Master Poster

Below code will show list of months

<?php	
$result = mysql_query("SELECT distinct monthname(u_reg_date) as month FROM tbl_localnews"); 
while ($row = mysql_fetch_array($result)) 
{	
	print("<br><a href='news.php?month=".$row['month']."'>News for ".$row['month']."</a>");	
}
mysql_free_result($result);
?>

monthname(u_reg_date) directly gives you month name from database so you dont have to do date('F',strtotime($row))

news.php

<?
	$month = $_REQUEST['month'];
	$result = mysql_query("SELECT *,monthname(local_date) as month FROM tbl_localnews where monthname(local_date)='".$month."'  ORDER BY local_date DESC "); 
	echo '<h1>'.$month.'</h1>';
	while ($row = mysql_fetch_array($result)) 
	{			
		print("<p><b>".$row['local_title']."</b></p>");
		print("<p>".$row['local_desc']."</p>");
	}
	mysql_free_result($result);
?>
vibhaJ 126 Master Poster

Thanks. It really works. Can i ask one thing? How am i going to connect this one News for November that it will only display in that month data?

It can be achieved by this code.

<?php	
$last_month = "";
$result = mysql_query("SELECT *,monthname(local_date) as month FROM tbl_localnews ORDER BY local_date DESC limit 0,10"); 
while ($row = mysql_fetch_array($result)) 
{	
	if ($row['month'] != $last_month)
	{
		print("<h2>News for ".$row['month']."</h2>");
		$last_month = $row['month'];
	}
	print("<p><b>".$row['local_title']."</b></p>");
	print("<p>".$row['local_desc']."</p>");
}
mysql_free_result($result);
?>
vibhaJ 126 Master Poster

Here is some modification with ur code...

<?php	
$last_date = "";
$result = mysql_query("SELECT * FROM tbl_localnews ORDER BY local_date DESC limit 0,10"); 
while ($row = mysql_fetch_array($result)) 
{
	if ($row['local_date'] != $last_date)
	{
		print("<h2>News for ".date('F j, Y',strtotime($row['local_date']))."</h2>");
		$last_date = $row['local_date'];
	}
	print("<p><b>".$row['local_title']."</b></p>");
	print("<p>".$row['local_desc']."</p>");
}
mysql_free_result($result);
?>

Try it out.

vibhaJ 126 Master Poster

For changing image follow below steps:
- one php page where user see his/her old uploaded image with browse button.
- when user upload image with browse andf click on update button, on server side in php code check if image is valid.
- if all is set then firstly unlink (delete) old image and upload new image in folder location and use 'update' sql query to update image name in database.

vibhaJ 126 Master Poster

Another option is you use another php page for process of login and use that page name in action of form.

<form action="login_action.php" method="post"><!--if they are not logged in they must do so-->
<table border="0">
<tr><td colspan=2><h1>Login</h1></td></tr>
<tr><td>Email:</td><td>
<input type="text" name="email" maxlength="40">
</td></tr>
<tr><td>Password:</td><td>
<input type="password" name="pass" maxlength="50">
</td></tr>
<tr><td colspan="2" align="right">
<input type="submit" name="submit" value="Login">
</td></tr>
</table>
</form>

login_action.php

<?php
include'database_conn.php';//connect to the database

if (isset($_POST['submit'])) 
{
	//runs if form has been submitted
	if(!$_POST['email'] | !$_POST['pass']) 
	{//makes sure the user has filled the form in
		die('You did not fill in a required field.');
	}
	if (!get_magic_quotes_gpc()) 
	{
		$_POST['email'] = addslashes($_POST['email']);//checks the form against the database
	}
	$check = mysql_query("SELECT * FROM users WHERE email = '".$_POST['email']."'")or die(mysql_error());//gives error is user doesnt exsist
	$check2 = mysql_num_rows($check);
	if ($check2 == 0) 
	{
		die('That user does not exist in our database. <a href=register.php>Click Here to Register</a>');
	}
	while($info = mysql_fetch_array( $check ))
	{
		$_POST['pass'] = stripslashes($_POST['pass']);
		$info['password'] = stripslashes($info['password']);
		$_POST['pass'] = md5($_POST['pass']);
	
		if ($_POST['pass'] != $info['password'])
		{//gives error if the password is wrong
			die('Incorrect password, please try again.');
		}
		else 
		{
			$_POST['email'] = stripslashes($_POST['email']);//if login is ok we add a cookie
			$hour = time() + 3600;
			setcookie(ID_my_site, $_POST['email'], $hour);
			setcookie(Key_my_site, $_POST['pass'], $hour);
			header("Location:account.php");//else redirect them to  account area
			exit;
		}
	}
}

?>
vibhaJ 126 Master Poster

can you debug using below code?

echo $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; exit;
$result=mysql_query($sql);

post your query in phpmyadmin sql tab, and see what you are getting.
post ur try.

vibhaJ 126 Master Poster

Use [code] tag in editor to post ur code.

vibhaJ 126 Master Poster

Firstly crosscheck whether register entry is done in database table or not?
Dude your php coding is in checklogin.php. So post that code...

vibhaJ 126 Master Poster

Generally ur php page should be such that all php coding appears on top of page and before html tags.

The error you are getting because of there is some thing in output before header function executes.
There should be no html tags or blank spaces before header.
I think you have some html tags before login.php included in index.php.

Post index.php code, i will clear your doubt.

vibhaJ 126 Master Poster

Try this code to check if select query returns at least one row.

<?
$table_first = 'recipe';
$query = "SELECT * FROM $table_first";
$resouter = mysql_query($query, $conn);


$doc = new DomDocument('1.0');
$root = $doc->createElement('recipes');
$root = $doc->appendChild($root);

while($row = mysql_fetch_assoc($resouter)){


$outer = $doc->createElement($table_first);
$outer = $root->appendChild($outer);

 foreach ($row as $fieldname => $fieldvalue) {
    $child = $doc->createElement($fieldname);
    $child = $outer->appendChild($child);
    $value = $doc->createTextNode($fieldvalue);
    $value = $child->appendChild($value);
  }// foreach
 //while
 
//---------------------------- fetch instructions ---------------------------
$table_second='instructions';
$query="SELECT instructions.instruction_id,instructions.instruction_text FROM $table_second where rec_id = ".$row['rec_id'];
$resinner=mysql_query($query, $conn);

$inner = $doc->createElement($table_second);
$inner = $outer->appendChild($inner);
if (mysql_num_rows($resinner) > 0){
while($row = mysql_fetch_assoc($resinner)){
    // add node for each record
    

    $inner1=$doc->createElement('instruction');
    $inner1=$inner->appendChild($inner1);
    // add a child node for each field
    foreach ($row as $fieldname => $fieldvalue) {
        $child = $doc->createElement($fieldname);
        $child = $inner1->appendChild($child);
        $value = $doc->createTextNode($fieldvalue);
        $value = $child->appendChild($value);
    } // foreach
 }}// while


//---------------------------- fetch ingredients ---------------------------
$table_third='ingredients';
$query="SELECT ingredients.ingredient_id,ingredients.ingredient_name,ingredients.ammount FROM $table_third where rec_id = ".$row['rec_id'];
$resthird=mysql_query($query, $conn);

$inner=$doc->createElement($table_third);
$inner=$outer->appendChild($inner);

if (mysql_num_rows($resthird) > 0){
while($row=mysql_fetch_assoc($resthird)){



     $inner2=$doc->createElement('ingredient');
    $inner2=$inner->appendChild($inner2);

    foreach($row as $fieldname=> $fieldvalue)
    {
        $child=$doc->createElement($fieldname);
        $child=$inner2->appendChild($child);
        $value=$doc->createTextNode($fieldvalue);
        $value=$child->appendChild($value);
    }
}}

}

mysql_close($conn);
$xml_string = $doc->saveXML();
echo $xml_string;
?>
vibhaJ 126 Master Poster

Try this code.
Run at ur end and post output.

<?
$table_first = 'recipe';
$query = "SELECT * FROM $table_first";
$resouter = mysql_query($query, $conn);


$doc = new DomDocument('1.0');
$root = $doc->createElement('recipes');
$root = $doc->appendChild($root);

while($row = mysql_fetch_assoc($resouter)){


$outer = $doc->createElement($table_first);
$outer = $root->appendChild($outer);

 foreach ($row as $fieldname => $fieldvalue) {
    $child = $doc->createElement($fieldname);
    $child = $outer->appendChild($child);
    $value = $doc->createTextNode($fieldvalue);
    $value = $child->appendChild($value);
  }// foreach
 //while
 
//---------------------------- fetch instructions ---------------------------
$table_second='instructions';
$query="SELECT instructions.instruction_id,instructions.instruction_text FROM $table_second where rec_id = ".$row['rec_id'];
$resinner=mysql_query($query, $conn);

$inner = $doc->createElement($table_second);
$inner = $outer->appendChild($inner);
while($row = mysql_fetch_assoc($resinner)){
    // add node for each record
    

    $inner1=$doc->createElement('instruction');
    $inner1=$inner->appendChild($inner1);
    // add a child node for each field
    foreach ($row as $fieldname => $fieldvalue) {
        $child = $doc->createElement($fieldname);
        $child = $inner1->appendChild($child);
        $value = $doc->createTextNode($fieldvalue);
        $value = $child->appendChild($value);
    } // foreach
 }// while


//---------------------------- fetch ingredients ---------------------------
$table_third='ingredients';
$query="SELECT ingredients.ingredient_id,ingredients.ingredient_name,ingredients.ammount FROM $table_third where rec_id = ".$row['rec_id'];
$resthird=mysql_query($query, $conn);

$inner=$doc->createElement($table_third);
$inner=$outer->appendChild($inner);
    
while($row=mysql_fetch_assoc($resthird)){



     $inner2=$doc->createElement('ingredient');
    $inner2=$inner->appendChild($inner2);

    foreach($row as $fieldname=> $fieldvalue)
    {
        $child=$doc->createElement($fieldname);
        $child=$inner2->appendChild($child);
        $value=$doc->createTextNode($fieldvalue);
        $value=$child->appendChild($value);
    }
}

}

mysql_close($conn);
$xml_string = $doc->saveXML();
echo $xml_string;
?>
vibhaJ 126 Master Poster

Firstly there should be relation between these three table recipe, instructions and ingredients.
Here you have selected all records in select query rather you should have select query in ingredients for perticular recipe(e.g. 'where' keyword must be there).
post your table structure to make select queries and new code.

vibhaJ 126 Master Poster

Try all possibilities and post any bug or issue if still exists.

vibhaJ 126 Master Poster

You dont have to pass username to included php page.
e.g. test.php

$username = $session->username;
include('function.php');

Once you have $username on test.php, you can use $username in function.php directly.

functions.php

echo "username is ".$username;
vibhaJ 126 Master Poster

First of all use CODE tag in editor to post your code.
Now when you have modified form with data filled.Add new hidden field with id.
So when you click on update on modify.php page, you can have $id = $_POST;
And you can have update query on that auto id.

<form name="form1" method="post" action="modify.php">
<input type="hidden" name="id" value="56" >
vibhaJ 126 Master Poster

It seems your query is not proper.
Replace ut code with below code to see mysql error.

$query = mysql_query("SELECT * FROM products") or die(mysql_error());
vibhaJ 126 Master Poster

Debug code using printing post array.And post your output.
BTW where is your form tag as this code is partial?

<?
	echo "<table border=1 align=center>";
	echo "<tr>";
	
	while($row = mysql_fetch_array($sellexe)
	{
	echo "<td colspan='3' align='right'><input type='checkbox' name='scow'>Sell"
	}
	echo "<td><input type='submit' name='submit' value='submit'></td>";
	echo "</tr>";
	echo "</table>";
	
	$se = $_POST[scow];
	//cho "$se";
	if(isset($_POST['submit']))
	{
		echo '<pre>';
		print_r($_POST);
		exit;
		
	$inssell = "UPDATE `farmlogin` SET `sellcow` = '$se' WHERE `cowid`='$id'";
	//echo "$inssell";
	$s = mysql_query($inssell);
	} 
?>
vibhaJ 126 Master Poster

You will only have value in $se = $_POST[scow]; if that checkbox is checked and form is submitted.
and value must be there for checkbox field.and whatever is value will be comes in $se. here $se will be 1.

echo "<td colspan='3' align='right'><input type='checkbox' value='1' name='scow'>Sell"
vibhaJ 126 Master Poster

You have to collect all image type extensions icon in one image folder.and rename it as given examples.
e.g.
jpg => jpg_type.png
png => png_type.png
gif => gif_type.png

Store all above image in one folder called 'image'.
Then try below code.

<?
	$imageFile = "imagename.jpg";
	$extAr = explode('.',$imageFile);
	$ext = strtolower($extAr[count($extAr)-1]);
	$iconPath = 'image/'.$ext.'_type.png'; // jpg_type.png
	echo '<img src="'.$iconPath.'" />'.$imageFile;	
?>
vibhaJ 126 Master Poster

Yes. there is no condition for setting session in your code.
So use else for setting session values.

if(isset($_POST['submit']))
{
   $name = mysql_real_escape_string($_POST['username']);
   $pass = mysql_real_escape_string($_POST['password']); 
   $mysql = mysql_query("SELECT * FROM users WHERE name = '{$name}' AND password = '{$pass}'"); 
   if(mysql_num_rows($mysql) < 1)
   {
     echo("<center>Password was an epic fail!</center>");
   } 
   else
   {
	   $_SESSION['loggedin'] = "YES"; 
	   $_SESSION['name'] = $name; 
	   echo("<center>W00p we have success!   <a href='acp.php'>Proceed to heaven</a></center>"); 
   }
}