nav33n 472 Purple hazed! Team Colleague Featured Poster

Check your spam box. Check if your smtp and smtp_port is configured properly in php.ini file. In general, SMTP_PORT is 25. Also check if your firewall isnt blocking the port.

nav33n 472 Purple hazed! Team Colleague Featured Poster

@ ShawnCplus, the code you have mentioned gives a hidden textbox and not a textarea !

@scru, Hmm..Thats can be done. But if you apply css to it, then obviously, it will hide the textarea again if the page is reloaded.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Asumming you have a hidden text area with the id "txarea"

How can you have a hidden text area ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

exist is an anagram of exits.

nav33n 472 Purple hazed! Team Colleague Featured Poster

@iamthwee, Unfortunately, you don't know the difference between stupidity and sarcasm.

nav33n 472 Purple hazed! Team Colleague Featured Poster

paypal or credit card ?

iamthwee commented: no -2
~s.o.s~ commented: 6 bags of rice. ;-) +20
nav33n 472 Purple hazed! Team Colleague Featured Poster

What's the error that you are getting ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

To avoid duplication in column(s) we can create it with unique costraint. Constraint is nothing but rules that you can impose on the columns to be unique or not null etc. To create a unique column you can have the codes like:
create table mytable(col1 datatype unique, col2 datatype,...)

Or declare it as a primary key. Primary key is a combination of both "not null" and "unique" constraints.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Oh, btw, if you have any duplicate rows, *I dont think it is possible to delete only the duplicate rows. You have to manually (:() delete them. *

Edit: The only way i can think of is, create a dummy table(new_table). Copy distinct rows from old_table to new_table. Truncate old_table. Copy the records from new_table to old_table. I cant think of ANY query to delete duplicate records from a table.

nav33n 472 Purple hazed! Team Colleague Featured Poster

To err is human, to forgive, divine !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Teacher, leave those kids alone.

nav33n 472 Purple hazed! Team Colleague Featured Poster

world wide web is a great invention (?!?)

nav33n 472 Purple hazed! Team Colleague Featured Poster

It will. If you don't want it to insert a duplicate value, you can initialise a session, add these values to the session, redirect to the same page using header function and then print the respective values using the session variables.

Eg.

<?php
session_start();
$conn=mysql_connect("dbhost","dbuser","dbpass");
mysql_select_db("database");
if(isset($_POST['submit'])){
	$field1=$_POST['field1'];
	$field2=$_POST['field2'];
	$_SESSION['field1']=$field1;
	$_SESSION['field2']=$field2;
	$query="insert into table (field1, field2) values (".$field1.",".$field2.")";
	mysql_query($query);
	 header("location: thispage.php");
}
?>
<html>
<body>
<FORM METHOD=POST ACTION="thispage.php">
	<INPUT TYPE="text" NAME="field1" value="<?php echo $_SESSION['field1'] ?>"><br />
	<INPUT TYPE="text" NAME="field2" value="<?php echo $_SESSION['field2'] ?>"><br />
	<INPUT TYPE="submit" name="submit" value="submit">
</FORM>
</body>
</html>
nav33n 472 Purple hazed! Team Colleague Featured Poster

It would be easier for us if you give us the structure of the tables and also the query that you are using.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Yep.. You are right about the redirecting methods. Umm.. but I am not aware of any other methods to clear data from $_POST/$_GET without refreshing the page.

nav33n 472 Purple hazed! Team Colleague Featured Poster
<?php
$reg = '/(&.*?;)/is';
$data="&reg; This is a registered company. &nbsp; &gt; &lt; is replaced by a whitespace.";
$rep="";
echo preg_replace($reg,$rep,$data);
?>

This is an example in php. $reg is the pattern that you want to search for. $data is a string which you want to search for the pattern. $rep is 'what' you want to replace $reg with.
I dont know much about the syntax of regex in .net, but the logic remains the same.

Hope it helps.
Nav

nav33n 472 Purple hazed! Team Colleague Featured Poster

simple. Soon after you execute your sql query, use header function to redirect the user to the same page. Eg.

<?php
$conn=mysql_connect("dbhost","dbuser","dbpass");
mysql_select_db("database");
if(isset($_POST['submit'])){
	$field1=$_POST['field1'];
	$field2=$_POST['field2'];
	$query="insert into rank (field1, field2) values (".$field1.",".$field2.")";
	mysql_query($query);
	 header("location: thispage.php");
}
?>
<html>
<body>
<FORM METHOD=POST ACTION="thispage.php">
	<INPUT TYPE="text" NAME="field1" ><br />
	<INPUT TYPE="text" NAME="field2" ><br />
	<INPUT TYPE="submit" name="submit" value="submit">
</FORM>
</body>
</html>

So, even if you refresh, it will do nothing, since $_POST is not set.

Hope it helps :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm..what's so difficult about it ? I hope you know the query to fetch the records from the table ?

$subject="Test mail";
$from="From : yourname@domain.com";
$query="select * from tablename";
$result=mysql_query($query);
while($row=mysql_fetch_array($result)){
   $email=$row['email'];
   $name = $row['name'];
  email($email,$subject,$message,$from);
}
nav33n 472 Purple hazed! Team Colleague Featured Poster

soup is what they serve in restaurants of china !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm..sometimes mails sent by php is considered as spam(because of the unknown domain). If that isn't the problem, check your smtp and smtp_port in php.ini.

nav33n 472 Purple hazed! Team Colleague Featured Poster

oh oops! :-O

<?php
$arr=array("data_01"=>1,"data_02"=>2,"data_03"=>3);
?>
nav33n 472 Purple hazed! Team Colleague Featured Poster

No. What he means is, he wants an array with user defined variables as index. Eg. instead of accessing the array like, $arr[0], $arr[1],.. he wants to access it like, $arr[$data_01], $arr[$data_02],...

I dont think its possible.

nav33n 472 Purple hazed! Team Colleague Featured Poster

yeah.. its confusing sometimes and most of the time, you tend to forget that you have a prefix !!

nav33n 472 Purple hazed! Team Colleague Featured Poster

http://www.javascriptkit.com/script/script2/tengcalendar.shtml

javascript datepicker with directions on how to use it.

nav33n 472 Purple hazed! Team Colleague Featured Poster

...for future reference, never declare a prefix, always leave this option blank.

May be they are talking about the prefix while creating a database. For example, if your host is somehost, it will add prefix somehost_databasename while creating a database. I guess thats what they mean by that.

nav33n 472 Purple hazed! Team Colleague Featured Poster

You are welcome.. keep reading the threads here. You will learn in no time ;)

nav33n 472 Purple hazed! Team Colleague Featured Poster

yeah.. you can do that as well..

<?php
if(isset($_POST['submit'])){
$conn=mysql_connect("localhost","root","password");
mysql_select_db("test");
	$name = $_POST['name'];
	$age = $_POST['age'];
	$query="insert into table (name,age) values ('$name','$age')";
$result = mysql_query($query);
}
?>
<html>
<body>
<form name="test" method="post" action="samepage.php">
Name: <INPUT TYPE="text" NAME="name" value="<?php echo $name ?>"><br />
Age: <input type="text" name="age" value="<?php echo $age ?>"><br />
<INPUT TYPE="submit" name="submit" value="submit">
</form>
</body>
</html>

:) yep.. thats all.

Nick Evan commented: Good job, keep up the good work! +3
nav33n 472 Purple hazed! Team Colleague Featured Poster

you can call the same page to do the insert operation. As in my example, I am calling the same page to insert the values to the table..

nav33n 472 Purple hazed! Team Colleague Featured Poster

Brewed drinks are boring !

nav33n 472 Purple hazed! Team Colleague Featured Poster
<?php
if(isset($_POST['submit'])){
	$name = $_POST['name'];
	$age = $_POST['age'];
	//insert into table
}
?>
<html>
<body>
<form name="test" method="post" action="samepage.php">
Name: <INPUT TYPE="text" NAME="name" value="<?php echo $name ?>"><br />
Age: <input type="text" name="age" value="<?php echo $age ?>"><br />
<INPUT TYPE="submit" name="submit" value="submit">
</form>
</body>
</html>

This is just an example program. Submit to the same page, do all the operation with your form variables, print those values in respective form elements.

nav33n 472 Purple hazed! Team Colleague Featured Poster

life is boring without a wife.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Normalization is a difficult theory to explain. You should read it yourself to understand it better. But in short, normalization is a process following which, you can optimize the performance of your database. (Eg. By avoiding obsolete data, duplication, and by using primary keys, etc).

Index is just like the index of a book. If you want a particular topic in a book, you refer the index page of that book and go to that respective topic. Index in database, is kinda same. It increases the speed w.r.t the operations on a table.

You should go through http://w3schools.com/sql/sql_intro.asp :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

you are welcome.

nav33n 472 Purple hazed! Team Colleague Featured Poster
nav33n 472 Purple hazed! Team Colleague Featured Poster

DML or Data manipulation language is nothing but "How do you manipulate the data in a table". You can manipulate the data in these ways.
1. Selecting the data from the table (Select)
2. Inserting the data to the table (Insert)
3. Updating the data in the table (Update)
4. Deleting the data from the table (Delete)

Data definition language means how do you define/change the database objects. They are,
1. Creating a database object Eg.Table (Create)
2. Changing the table structure (Alter)
3. Deleting/Dropping the table (Drop).


Edit: ravisen22 you beat me by 2 mins. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

if thats the case, why not generate one more random number ?

<?php
	$arr=array();
	for($i=0;$i<7;$i++){
		$arr[$i]="./img/images/".$i.".jpg";
	}
	$random=rand(0,6);
	$random_1=rand(0,6);
		echo "<img src=".$arr[$random].">";
		echo "<img src=".$arr[$random_1].">";
?>

This will do.. Don't you think ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

is there anything like world peace ?

nav33n 472 Purple hazed! Team Colleague Featured Poster
<?php
	$arr=array();
	for($i=0;$i<7;$i++){
		$arr[$i]="./img/images/".$i.".jpg"; //assigning the image location to the array $arr.
	}
	$random=rand(0,6); //generating a random number
	echo "<img src=".$arr[$random].">";
//printing the image
?>

Thats it :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

irritating people should be hanged.

nav33n 472 Purple hazed! Team Colleague Featured Poster

I'm particularly interested in whether dreamweaver written code already takes these issues into account.

Nope.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Again, what is the error you are getting ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

what is the error that you are getting ? What do you mean by cant seem to get it to work ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

lol.. hacker9801 is right.. htmlspecialchars will convert html characters like >, <, & to &gt; &lt; and so on.. and mysql_real_escape_string will escape all the special characters in user's input, like, /, ', " etc..

nav33n 472 Purple hazed! Team Colleague Featured Poster

this is your error dude:
$sql = "SELECT * FROM products;";
change that one to this one:
$sql = "SELECT * FROM products";

It doesn't matter if you have a ; in your query.

nav33n 472 Purple hazed! Team Colleague Featured Poster

balloons are made of frog skin !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Dang ! Do you really need this level of encryption :D ! But anyways, What do you mean by 2 arrays with 2nd code ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Check out the link that i have mentioned. It says the way to 'decrypt' the dump generated by microsoft windows when it crashes. You can analyse the dump file to know what caused the error.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Thank you, Please read the text again,
I want to download a file from a sub folder.

Which sub folder ? You can concat the path of the sub folder like $dwnld = "path/of/the/subfolder/here/File1.zip";

nav33n 472 Purple hazed! Team Colleague Featured Poster
$user_id=$_POST['UserID'];
$password=$_POST['Password'];
$query="select * from Customer where
UserID = '$user_id' and Password = '$password'";
echo $query;
$result=mysql_query($query) or die(mysql_error());

Check what $query prints. Execute the same in phpmyadmin.

oh, and please, next time you post your code, put it in [code] tags.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Mind reading is a skill that I possess.