lyrico 23 Junior Poster in Training

Hello Guys,

Can anyone help me regarding this search engine I want to implement on my script?
Let's say i have 5 files (file11.txt, file12.txt, file13.txt, file14.txt and file15.txt) on my folder named FILES. Now i want to write script that when i search for a particular words, it will search all the 5 .txt files and display the particular file where the searched word appear.

For example, file1.txt and file2.txt contain a words "hello world", but file3 - file5.txt does not have that word. So when i search for the word "hello world", the script should tell that file1.txt and file2.txt contains the word "hello world".

Please guys. I will really appreciate any help regarding this. Thanks so much.

lyrico 23 Junior Poster in Training

you can use submit instead of button. try to analyze this code.

//assume that the file name of this script is test.php
<?php

 if($_POST['submit']=="Test")
 {
    echo "test";
 }

 echo "<form action='test.php' method='post'>";
 echo "<input type='submit' name='submit' value='Test'>";
 echo "</form>";
 
?>
pritaeas commented: well spotted +14
karthik_ppts commented: Yes +7
lyrico 23 Junior Poster in Training

Hi all,

Can anyone help me or give me an idea on how export data from mysql into multiple excel sheet using php? Below is the code I used to export data from mysql in a single excel sheet. thanks in advance

<?php
	
	$filename = 'filename.csv';

	include 'connection.php';
	
	$date = date("m/d/Y");

	header("Content-type: appilication/x-msexcel");
	header("Content-disposition: attachment; filename=".$filename);
	header("Pragma: no-cache");
	header("Expires: 2");

	$csv_output1='LINE'.",";
	$csv_output1.='SHIFT'.",";
	$csv_output1.='FUNCTION'.",";
	$csv_output1.='EMPLOYEE ID'.",";
	$csv_output1.='NAME'."\n";

	
	echo $csv_output1;
	
	$view=mysql_query("SELECT * FROM tbl_name where Date='$date'");
		
		while($result=mysql_fetch_array($view))
		{
			$a = $result['Line'];
			$b = $result['Shift'];
			$c = $result['Function'];
			$d = $result['EmpNo'];
			$e = $result['EmpName'];
					
			$csv_output=$a.",";
			$csv_output.=$b.",";
			$csv_output.=$c.",";
			$csv_output.=$d.",";
			$csv_output.=$e.",";

			echo $csv_output;
		}
		
		exit;
?>
lyrico 23 Junior Poster in Training

Thanks for your reply elwafdy.

I found the answer by my self through the help to google.

lyrico 23 Junior Poster in Training

Hi to all,

Can anyone help me to show the code how to save multiple data into mysql via PHP? Thanks in advance.

Here's some code

<?php

  echo "<form action='savetoanothertable.php' method='post'>";
  $query = mysql_query("SELECT * FROM tbl_student");
  while($result = mysql_fetch_array($query)
  {
    echo "<input type='text' name='studname' value='$result[studentname]'>";
    echo "<input type='text' name='studno' value='$result[studentnumber]'>";
    echo "<br>";
//lets say i have 5 students on my tbl_student. so we can expect on this code that we have 10 text box(5 for studentname and 5 for student number)
  }

  echo "<input type='submit' name='submit' value='submit'>";
  echo "</form>";

my question is, what is the code for savetoanothertable.php for me to save the above 10 record into another table. please help. thanks so much.

lyrico 23 Junior Poster in Training

I think this can help you.

<?php

$t1 = strtotime('2011/09/19 09:18:22 AM');
$t2 = strtotime('2011/09/22 03:22:18 PM');

$delta_T = ($t2 - $t1);

$day = round(($delta_T % 604800) / 86400); 
$hours = round((($delta_T % 604800) % 86400) / 3600); 
$minutes = round(((($delta_T % 604800) % 86400) % 3600) / 60); 
$sec = round((((($delta_T % 604800) % 86400) % 3600) % 60));



echo $day." days"."<br/>";
echo $hours." hours"."<br/>";
echo $minutes." minutes"."<br/>";
echo $sec." sec"."<br/>";
?>
lyrico 23 Junior Poster in Training

Hello Guys,

Can anyone help me to get time difference in PHP?

For example:

<?php

$Start = "09:18 AM";
$End = "04:10 PM";

$diff = ????

Can anyone show the code for $diff? thanks in advance and more power.

lyrico 23 Junior Poster in Training

Hello Guys.

Is there anyone here who can help me how to add shadow in div (browser is IE8). Thanks.
This Code doesn't work.

</style type='text/css'>
.main_div
{
  width:100;
  height:100;

  -webkit-box-shadow: #111 0 -2px 6px;  
  -moz-box-shadow: #111 0 -2px 6px;  
  box-shadow: #111 0 -2px 6px;

}
</style>
<div class='main_div'>
<p>Div with shadow
</div>
lyrico 23 Junior Poster in Training

Thanks Zero13 and pbcomput. Your suggestion really helps. ^^,

lyrico 23 Junior Poster in Training

Hi to All,

Is this code can be done with link <a hef=''>?

<?php
 
  echo "<form action='page.php' method='post'>";
  echo "<input type='submit' name='submit' value='Go to Page'>";
  echo "</form>";
  
  if($_POST['submit']=="Go to Page")
  {

  }

?>

in the code above, once the user click the button, the page load and execute whatever script inside *if($_POST=="Go to Page")*. My question is that, instead of using button, i want to use a link <a href='page.php'>?

Any Idea? Please help.

Thanks a lot.

lyrico 23 Junior Poster in Training
lyrico 23 Junior Poster in Training

Can anyone clarify how I can use a sliding div animation like the one here but instead of using displaying a div on the same page, it loads a new page and then unveils the div.

ie. I want to use it for my navigation links which go to different pages. When the page loads Id like the div to appear using the animation effect as opposed to just being there. Then when the user clicks another navigation link, the div will animate away and the new page will load and the new div will animate in again.

Any guidance?

lyrico 23 Junior Poster in Training

Thanks Kraai, but it doesn't work

lyrico 23 Junior Poster in Training

Hi to all,

I am PHP developer and found many problems regarding cross browser issue.
Here's the problem:
I want a rounded div with shadow. My CSS codes works at FF but not in google chrome. Please help. Thanks in advance.


Here's my code:

<style type='text/css'>

.main{float:none;position:relative;width:980;background:white;height:500;margin:0px auto;top:10;}

#shadowBox
{
-moz-border-radius: 1em 0em 1em 0em;
border-radius: 1em 0em 1em 0em;

-moz-box-shadow: 3px 3px 3px 5px #bbb;
-webkit-box-shadow: 3px 3px 3px 5px #bbb;
box-shadow: 3px 3px 3px 5px #bbb;
}

</style>

<div class='main' id='ShadowBox'>

</div>
lyrico 23 Junior Poster in Training

I have same problem as samsnov. The problem can be call as cross browser issue. For example, when you run the script into IE, the design looks fine. But when you run it using FireFox, you can found many problem regarding its design.

Can anyone here give some advise or tip on how to solve cross browser issue?

lyrico 23 Junior Poster in Training

Hi everyone,

I need some help now.

Can anyone show me a script on how can shared folder (not folder on the server) open using php? I mean my server's IP is 10.10.10.1 and then some shared folder are on the IP 10.10.10.2. Now I want to access the shared folder on 10.10.10.2

The idea is:

<?php

echo "<form action='\\10.10.10.2' method='post'>"; //I know this is wrong, but just to give you the idea.
echo "<input type='submit' name='submit' value='Go to Shared Folder'>";
echo "</form>"

?>

Thanks in advance guys.

lyrico 23 Junior Poster in Training

Try this idea.

<?php
// sql connection here

$query = mysql_query("select * from tbl_name order by number_of_jobs desc");
while($result=mysql_fetch_array($query))
{
   echo $result['company_name'];
   echo $result['number_of_jobs']."<br>";
}

?>
lyrico 23 Junior Poster in Training

Okay. So you want to clear the cookie and not the session. Think about this. Even the big socializing site (facebook for example) don't have that kind of security. So honestly its hard to give an idea on how to do that.

lyrico 23 Junior Poster in Training

Maybe it can by signing out into the website and not by closing the browser.

lyrico 23 Junior Poster in Training

Try this.

<?php

// your database connection here

echo "<select name='dropdown1'>";
$query = mysql_query("SELECT * from employeedetails");
while($result=mysql_fetch_array($query));
{
echo "<option name='id_list'>".$result['EmployeeID']."</option>";
}

echo "</select>";

?>
lyrico 23 Junior Poster in Training

If your problem was solved, your can now marked this thread as solved. ^^,

lyrico 23 Junior Poster in Training

Just place the delete query into the top of display query.

Sample

<?php

$sql="DELETE FROM table_name WHERE id='$ids'";

$query=mysql_query("select * from tbl_name");
while($result=mysql_fetch_array($query))
{
   //blah blah blah
}
lyrico 23 Junior Poster in Training

You can use substr.
Example.

<?php
  
  $date="March 21, 2011 - 06:30 PM";
 
  $time = substr($date,17,8); // this means you will eliminate 17 characters (March 21, 2011 - ) "including the space", and then print out the 8 characters.
  echo $time; // the output will be 06:30 PM

 
?>

you can also google substr tags.

daniel7912 commented: thanks! +0
lyrico 23 Junior Poster in Training

You can refer to this idea.
Lets say you have name, address and id to your table both table a and b.

<?php

 $query = mysql_query("SELECT * FROM table_a");
 while($result = mysql_fetch_array($query))
 {
   $name = $result['name'];
   $address = $result['address'];
   $id = $result['id'];

   mysql_query("INSERT INTO table_b (name,address,id) values('$name','$address','$id')");
   mysql_query("DELETE FROM table_a where id='".$id."'");
 }
 
?>

once the loop finished, all the data on table_a will transfer to table_b.

lyrico 23 Junior Poster in Training
// code for your form
<input type='text' name='userid' maxlenght='10'>

//code for php
<?php
 
 $userid = $_POST['userid'];
 $userid1 = substr($userid,0,9);
 $userid2 = substr($userid,9,1);

 if(is_numeric($userid1)==true && $userid2=="V")
 {
   echo "correct userid format";
 }

 else
 {
   echo "User ID does not meet the required format.";
 }

?>
lyrico 23 Junior Poster in Training

Kekkaishi code works fine. ^^, try it.

lyrico 23 Junior Poster in Training

I can do that but it needs a long coding. Ahm just let me browse the internet for it, and see what I can got. hehehe

lyrico 23 Junior Poster in Training

Hi Kadafiz. Try this idea.

1. You can restrict the "userID text box" to make it accept only integers (0-9) using javascript. here's the code.

<HTML>
   <HEAD>
   <SCRIPT language=Javascript>
      
      function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;

         return true;
      }
    
   </SCRIPT>
   </HEAD>
   <BODY>
      <INPUT onkeypress="return isNumberKey(event)" type="text" name="userID" maxlength="9">
   </BODY>
</HTML>

2. Restrict again your "userID textbox" to make it allow 9 digits only using maxlength
3. Now just define the last character which is the letter V. someting like

<?php

$id = $_POST['userID']."V";

?>

So you can now sure that the user will input only the required ID format.

I hope that could help you.

lyrico 23 Junior Poster in Training

Try this

<?php


if($_POST['submit']=="Submit")
{
	$text1 = $_POST['text1'];
	$text2 = $_POST['text2'];
		
	if($text1 =="" || $text2=="")
	{
	?>
	<head>
		<script type='text/javascript'>
			alert('Some text here.');
		</script>
	</head>
	<?php
	}
       else
       {
       //what do you want when the two textbox have value
       }

}

echo "<form action='index.php' method='post'>";
echo "<input type='text' name='text1' value='$text1'>";
echo "<input type='text' name='text2' value='$text2'>";
echo "<input type='submit' name='submit' value='Submit'>";

?>
lyrico 23 Junior Poster in Training

It depends on some browser. But you can try this.

<form action='page2.php' method='post' target='_blank'>

All version of IE supports the target='_blank' tags.

lyrico 23 Junior Poster in Training

Just use dot (.)

<?php
 
  $text1 = "World";

  echo "Hello ".$text1; //The output will be Hello World

  $text2="Hello";

  echo $text2." World"; //The output will be Hello World
?>
lyrico 23 Junior Poster in Training

You can found that at the top of the comment text area. There a header "Has this thread been answered", just click "Mark this thread as solved" (underlined text).

lyrico 23 Junior Poster in Training

Anyway are you creating Log in script or a Sign up script?
But anyway, try this Jrotunda. (taga pinas ka ba?)

<?php
//maybe your need here something like...
$input_username = $_POST['username']; // user input. This is the value that will be check if already exist in the DB
$input_email = $_POST['email'];        // user input. This is the value that will be check if already exist in the DB
$SQL = mysql_query("SELECT Username from user");
while($result = mysql_fetch_array($SQL))
{
  $exist_username = $result['Username']'
  $exist_email = $result['Email']'
}

if($input_username == $exist_username || $input_email == $exit_email)
{
  echo "$input_username and/or $input_email already exist/used";
}

 
else
{

}
?>
lyrico 23 Junior Poster in Training

You can now mark this threads as solved ^^,

lyrico 23 Junior Poster in Training

Just put your update query at the top, so when the page was load, the script update first the record and then display the result.

Try the code below.

<?php
$con = mysql_connect("localhost","root","");

$sql = mysql_select_db("luweegee",$con);
?>
<html>
<head><link rel='stylesheet' type='text/css' href='Style.css'/></head>
	  <body>
	  <table border=0 align='center' width=900 cellpadding=20 cellspacing=0>
	  <tr><td  class='title' colspan=2><h1>Update Record</h1></td></tr>
 
		<tr>
		<td class='borderBaba' colspan=2></td>
		</tr>
 
<tr>
<td class='form' valign='top'>
<ul>
<a class='navigation' href='View.php'><li>View Record</li></a>
<a class='navigation' href='Add.php'><li>Add Record</li></a>	
<a class='navigation' href='Edit.php'><li>Edit Record</li></a>
<a class='navigation' href='Delete.php'><li>Delete Record</li></a>
</u>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
 
 
<td class='Addstyles' valign='top'>
<table class='Addstyle' border=0 width=550 cellpadding=5 cellspacing=0>
 
<?php
// put the update query here.

if($_POST['submitEditForm'])
{
	$update = mysql_query("UPDATE resume SET name='$_POST[name]', age='$_POST[age]', sex='$_POST[sex]', mobile='$_POST[mobile]' WHERE id='$_POST[idnumber]'");
		}
echo"<form method='post' action='Edit.php'>
<tr>
		<td  class='viewTable1'><center>Name</center></td>
		<td  class='viewTable1'><center>Age</center></td>
		<td  class='viewTable1'><center>Sex</center></td>
		<td  class='viewTable1'><center>Mobile</center></td>
		<td  class='viewTable1'><center>Action</center></td>
</tr>
		";
	$sel = mysql_query("SELECT * FROM resume");
	while($data=mysql_fetch_array($sel))
		{
		echo "<tr>
				<td ><center>$data[name]</center></td>
				<td><center>$data[age]</center></td>
				<td><center>$data[sex]</center></td>
				<td><center>$data[mobile]</center></td>
				<td><center><input type='submit' value='Update' name='updateButt$data[id]'></center></td>
			  </tr>";
		}
 
	echo "</table></form>";
echo "<br><BR>";
 
		for($x=0;$x<=100;$x++)
		{
			if($_POST[updateButt.$x])
			{
			$select = mysql_query("SELECT * FROM resume WHERE id=$x");
				while($data=mysql_fetch_array($select))
				{
					echo "
					<form name='myform' method='post' action='Edit.php'>
					<table border=0 cellspacing=0 align='center' class='Addstyle'>
	<tr><td align='right' class='viewTable5' colspan=2><div class='textfile'>Editing: <span class='underline'>$data[name]</span></div></td></tr>
					<input size=20 type='hidden' value=$data[id] name='idnumber'>	
					<tr><td>Name: </td><td><input type='text' size=20 name='name'/></td></tr>
					<tr><td>Age: </td><td><input type='text' size=20 name='age'/></td></tr>
					<tr><td>Sex: </td><td><input type='text' size=20 name='sex'/></td></tr>
					<tr><td>Mobile: </td><td><input type='text' size=20 name='mobile'/></td></tr>
					<tr><td colspan=2><input type='submit' value='Submit' name='submitEditForm'/></td></tr>
 
				</table></form>
				";		
				}
			}
		}
 
		
 
?>
</td>
</tr>
<tr>
<td class='borderBaba' colspan=2 align='center'>
<br>Copyright 2011 ©  All Rights Reserved<br><br>
</tr>
</td>
</table>
</body>
</html>
lyrico 23 Junior Poster in Training

try this.

<img src='<?php echo $targetpath;?>'>

If this code don't work, maybe you can post your viewproducts script here.

lyrico 23 Junior Poster in Training

I modified your code. Take a look at the * sign.

* is partner with *, and ** is partner with **, and *** is partner with ***, and so on

The problem is you have { in your foreach, and yet you forgot to put } at the end of the foreach statement.

<?php
 
require_once("config.php");
 
//Connect to mysql server
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if(!$link) {//*
	die('Failed to connect to server: ' . mysql_error());
}//*
 
//Select database
$db = mysql_select_db(DB_DATABASE);
if(!$db) {//**
	die("Unable to select database");
}//**
 
//Create query
$qry=("SELECT * FROM registrants");
$result=mysql_query($qry);
 
//Run through the records retrieved with the MySQL query.
while($row = mysql_fetch_array($result, MYSQL_ASSOC)){//***
	//set a to the first week
	$a = 1;
	$output .= '<input name="id'. $row[id] . '" type="hidden" value="' . $row[id] . '" />'; //Setup the hidden input so each row has its own id.
	$output .= 'Name: ' . $row[f_name] . ' ' . $row[l_name]; //Output the first and last name with a space between them.
	$week = explode(",",$row[x]); //Turn row[x] into an array with the explode command, where x is the name of the field
	foreach ($week as $w){//**** //for every item in the array week do the following
		//Store the information into the variable output
		$output .= 'Week ' . $a .' 
		<select name="week'. $row[id] . '[]">
			<option value="Yes">yes</option>
			<option value="No">No</option>
			<option value="' . $w .'" selected="selected">' . $w .'</option>
		</select>';
	$a += 1}; //Increase the count by 1
}//**** this the problem
} //***
 
?>
lyrico 23 Junior Poster in Training

I'm not sure but I think the problem is that you did not define what is $id in your update query.

//if the user press the submitEditForm, where is the $id?
if($_POST['submitEditForm'])
{
// maybe you need here something like...
$id=$_POST['id'];
$update = mysql_query("UPDATE resume SET name='".$_POST["name".$id]."', age='".$_POST["age".$id]."', sex='".$_POST["sex".$id]."', mobile='".$_POST["mobile".$id]."' WHERE id='".$id."'");
 }

In your code, the script can not identify what record you want to update. Also, I'm not sure if your update query is correct. I mean, this is the first time I saw that kind of update query. Try to declare the value of $id and try to use my suggested update query. Since your activity is urgent, I think this is the last help i can offer for today.

lyrico 23 Junior Poster in Training

Try this update query;

mysql_query("UPDATE resume SET resume.name='$_POST[name]' WHERE id='".$id."')";
mysql_query("UPDATE resume SET resume.age='$_POST[age]' WHERE id='".$id."')";
mysql_query("UPDATE resume SET resume.mobile='$_POST[mobile]' WHERE id='".$id."')";
mysql_query("UPDATE resume SET resume.sex='$_POST[sex]' WHERE id='".$id."')";
lyrico 23 Junior Poster in Training

Try this.

$query=mysql_query("select * from table_name");
echo "<table>";
echo "<tr>";
echo "<td>"."ITEM NAME"."</td>";
echo "<td>"."ITEM PRICE"."</td>";
while($result=mysql_fetch_array($query))
{
  $item=$result['item_id'];
  if(isset($_POST[$item])!=NULL)
  {
    $query1 = mysql_query("SELECT * FROM table_name where item_id='".$item."'");
   
    while($result1 = mysql_fetch_array($query1))
    {
      echo "<tr>";
      echo "<td>".$result1['item_name']."</td>";
      echo "<td>".$result1['price']."</td>";
     }
 
        echo "</table>";
 
  }				
 
}
lyrico 23 Junior Poster in Training

You can now mark this thread as "Solved"

lyrico 23 Junior Poster in Training

There are lots of tutorial inside the net. Try to google it. The tutorials are easy to follow.

lyrico 23 Junior Poster in Training

I got some error. Just change $query to $query1 on below query:

if(isset($_POST[$item])!=NULL)
  {
    $query1 = mysql_query("SELECT * FROM table_name where item_id='".$item."'");
    echo "<table>";
    echo "<tr>";
    echo "<td>"."ITEM NAME"."</td>";
    echo "<td>"."ITEM PRICE"."</td>";
    while($result = mysql_fetch_array($query)) //change $query into $query1
    {
      echo "<tr>";
      echo "<td>".$result['item_name']."</td>";
      echo "<td>".$result['price']."</td>";
     }
 
        echo "</table>";
 
  }
lyrico 23 Junior Poster in Training

Try this script:
Imagine that your table has the following fields:
item_name, price, and item_id for the ID for each items.

<?php

    error_reporting(0);
    session_start();
//your db connection here.

// First, query all the items in your table.
$query = mysql_query("SELECT * from table_name");
echo "<table>";
echo "<tr>";
echo "<td>"."ITEM NAME"."</td>";
echo "<td>"."ITEM PRICE"."</td>";
echo "<form action='submit_item.php' method='post'>";
echo "<td>"."<input type='submit' name='submit' value='Add Item'>"."</td>";
while($result = mysql_fetch_array($query))
{
  echo "<tr>";
  echo "<td>".$result['item_name']."</td>";
  echo "<td>".$result['price']."</td>";
  echo "<td>"."<input type='checkbox' name='$result[item_id]' value='$result[item_id' id='$result[item_id'>"."</td>";
}
echo "</form>";
echo "</table>";

Above code display all items in the table_name together with checkbox.
Now here's the code for submit_item.php where you can submit all checked items.

<?php
  error_reporting(0);
  session_start();
//your db connection here.

$query=mysql_query("select * from table_name");
while($result=mysql_fetch_array($query))
{
  $item=$result['item_id'];
  if(isset($_POST[$item])!=NULL)
  {
    $query1 = mysql_query("SELECT * FROM table_name where item_id='".$item."'");
    echo "<table>";
    echo "<tr>";
    echo "<td>"."ITEM NAME"."</td>";
    echo "<td>"."ITEM PRICE"."</td>";
    while($result = mysql_fetch_array($query))
    {
      echo "<tr>";
      echo "<td>".$result['item_name']."</td>";
      echo "<td>".$result['price']."</td>";
     }

        echo "</table>";
    						
  }				
			
}

?>
lyrico 23 Junior Poster in Training

Make sure that your folder is writable.

lyrico 23 Junior Poster in Training

Maybe the problem is *. Try the sample query of olawale.

lyrico 23 Junior Poster in Training

Try this sample idea.
First, create a table with the following fields. user_name,user_img and user_id. Set user_id as your primary key. It can be integer that increment automatically. Save the table as userfile

Create a PHP connection script. In this example we save it as connection.php. Below is the code.

<?php
     
    error_reporting(0);
    $connection = Mysql_connect('localhost','root','');
    mysql_select_db('name_of_db');
?>

You can now create another page which will allow the user to save their profile. Lets say we save this script as save_profile.php

<?php

    error_reporting(0);
    session_start();
    include 'connection.php';

echo "<form action='save_profile.php' method='post' enctype='multipart/form-data'>";
echo "USER NAME : <input type='text' name='username'>"."<br>";
echo "PICTURE : <input type='file' name='file' id='file'>"."<br>";
echo "<input type='submit' name='submit' value='Save'>";
echo "</form>";

if($_POST['submit']=="Save")
{
   $user = $_POST['user'];
   $img = "image_folder/".$_FILES["file"]["name"];

//now move/save or store the image file into the folder.
//you must also create a folder named image_folder in your drive together with this php script.
move_uploaded_file($_FILES["file"]["tmp_name"],"../wwwroot/image_folder/".$_FILES["file"]["name"]);

 $query = mysql_query("INSERT INTO userfile(user_name,user_img) values('$user','$img')");
  
}

?>

Now here's the code in viewing. (Hay naku. medyo nahihirapan nako.)

<?php
error_reporting(0);
session_start();
include 'conn.php';

$query = mysql_query("SELECT * from userfile");
echo "<table>";
echo "<tr>";
echo "<td>"."NAME"."</td>";
echo "<td>"."PICTURE"."</td>";
while($result = mysql_fetch_array($query))
{
   echo "<tr>";
   echo "<td>".$result['user_name']."</td>";
?>
   <td><img src="<?php echo $result['user_img'];?>"></td>
<?php
 echo "</table>";


}

?>

Obviously, this code is very general. But I think you can have at least a little knowledge/idea on what you want. I hope this can help.

lyrico 23 Junior Poster in Training

ahm ok. so try this code again.

<?php

$connect = Mysql_connect("localhost","root","");
mysql_select_db("name_of_your_db");

echo "<h1>Register</h1>";
$submit = $_POST["submit"];
$usernamenew = strip_tags($_POST["usernamenew"]);
$passwordnew = md5(strip_tags($_POST["passwordnew"]));
$repeatpasswordnew = md5(strip_tags($_POST["repeatpasswordnew"]));
$email = $_POST["email"];
$date = date(Y-m-d);
 
if ($_POST['submit']=="Create Account")
{
    //check for existence
    if ($usernamenew=="" || $passwordnew=="" || $repeatpasswordnew=="" || $email=="")
    {    
        echo "Please fill in all the blanks!";    
    }
 
    else
      {
           if ($passwordnew == $repeatpasswordnew)
           {
              $sql = mysql_query("INSERT INTO users (username,password,email,date) VALUES ('$usernamenew','$passwordnew','$email','$date'");
            }
            
               else
                 {
                     echo "The passwords you entered do not match!";
                 }
        }   
}
 
?>
 
 
<html>
    <form action="register.php" method="POST">
 
        NEW USERNAME:<input type="text" name="usernamenew" maxlength="25" /><br>
        NEW PASSWORD:<input type="password" name="passwordnew" maxlength="25" /><br>
        REPEAT NEW PASSWORD:<input type="password" name="repeatpasswordnew" maxlength="25" /><br>
        EMAIL ADDRESS:<input type="text" name="email" maxlength=64 /><br>
        <input type="submit" name="submit" value="Create Account" />
 
    </form>
</html>
lyrico 23 Junior Poster in Training

Can you give some example code for us to have an idea regarding your script?

lyrico 23 Junior Poster in Training

Visit this link for the answer:
http://bytes.com/topic/php/answers/11005-n-doesnt-work

or you can try to google this topic "\n doesn't work at php"