nav33n 472 Purple hazed! Team Colleague Featured Poster

echo "<tr bgcolor=$bg>"; instead of echo "<tr>";

nav33n 472 Purple hazed! Team Colleague Featured Poster

-750

nav33n 472 Purple hazed! Team Colleague Featured Poster

Plan
ate
net

Visualization

nav33n 472 Purple hazed! Team Colleague Featured Poster

Use blank index.html/index.php in the folder with flash files (simplest method). Or, as Auzzie has mentioned, use .htaccess.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Second Query= SELECT * FROM reg_personal inner join reg_english_level inner join reg_services inner join reg_status ON(reg_personal.personal_code=reg_english_level.english_code AND reg_english_level.english_code=reg_services.services_code AND reg_services.services_code=reg_status.status_code)WHERE LIMIT 0,5

LIMIT 0,5 cannot be in the where clause. And, there's no bug in php w.r.t inner joins and limit.

nav33n 472 Purple hazed! Team Colleague Featured Poster

No. $x="person".$number."male";
echo $$x will print the value stored in $person1male. (considering $number has the value 1 in it!)

OmniX commented: Once again helped me with another php problem, thanks ;) +1
nav33n 472 Purple hazed! Team Colleague Featured Poster

Yep. Or you can write the comments to a file and then display the contents of that file.

whoisit commented: Always willing to help. +1
nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

-745

nav33n 472 Purple hazed! Team Colleague Featured Poster

Very simple. List all the comments in the table(if any), have a textarea and a button. When the button is clicked, add the contents of textarea to the comments column.
Eg.

<?php
//connect
//select db

if(isset(submit button)){
 if(!empty(textarea){
  //insert into table (comments) values (textarea_contents)
}
}
//query to display the poem.
//print the poem.
$q="select comments from table where poem_id=$id";
//print the comments
?>
<form>
<textarea name=comments></textarea>
<submit button>
</form>
nav33n 472 Purple hazed! Team Colleague Featured Poster

Lol.. Welcome :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Your insert query works fine on my computer. Check if you have the column names right. Also escape all the special characters using addslashes .

nav33n 472 Purple hazed! Team Colleague Featured Poster

-741

nav33n 472 Purple hazed! Team Colleague Featured Poster

well, the variables are assigned within the form:

<form method="post" action="welcome.php" >
<p><label for="name">Username:</label> <input type="text" name="name"></p>
<p><label for="password">Password:</label> <input type="password" name="password"></p>
<p><label> Status:</label><select>
<option>Admin</option>
<option>Staff</option>
</select></p><br>

does it make sense? and i already changed the extension to .php ...

You aren't assigning these values to the session variables on submit. ie.,
$_SESSION=$_POST;
... and so on..

nav33n 472 Purple hazed! Team Colleague Featured Poster

Thats because $_SESSION, $_SESSION , $_SESSION might be empty. Where are you assigning the values for these session variables ? And Its always better to have .php extension to your scripts. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

yep. print out the array values by using print_r($test). You will know what values does the array $test contains.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Nothing wrong with the code. Check if $_POST is correct. Check all the post-ed form variables by using print_r($_POST) in welcome.php.

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) You are welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Ah! thats because, you don't have a name for submit button, but you are checking if submit is set. if(!isset($_POST['submit'])){ Just give a name to submit button. name="submit" and it will work.

nav33n 472 Purple hazed! Team Colleague Featured Poster

-737

nav33n 472 Purple hazed! Team Colleague Featured Poster

-735

nav33n 472 Purple hazed! Team Colleague Featured Poster

-733

nav33n 472 Purple hazed! Team Colleague Featured Poster
<?php
ini_set("display_errors","on");
error_reporting(E_ALL);
$username = $_POST["name"];
$password = $_POST["password"];
$status = $_POST["status"];
$department = $_POST ["depart"];
$duemonth = $_POST ["due"];
$category = $_POST ["cate"];
$amount = $_POST ["amount"];
$specification = $_POST ["spec"];
if(!isset($_POST['submit'])){
?>
<html>
<head>
<title>::. CLAIM FORM</title>
<link rel="stylesheet" type="text/css"
href="my.css">
</head>
<body>
<br><br><br><br><br><br><br><br><br><br><br>
<h1>Welcome to the claim page.</h1>
<hr size=2 width=500px>
<h1>Please fill in all the details as required. Incomplete data 

will not be considered.</h1>
<div class="form-container">
 <form method="post" action="<?php echo $PHP_SELF;?>">

		<div><label>Name:<?php echo  $_POST["name"];?></label><br></div>
			<div><label 

for="type">Department:</label>
				<select name="depart">
					<optgroup label="---

SELECT---">

					
<option>KKK</option>							
<option>KEE</option>					
<option>KPM</option>					
<option>KMP</option>					
<option>KKA</option>										
<option>KBP</option>					
<option>KAA</option>
					</optgroup>
				</select>
				</div>
			
			<div><label for="type">Due month:</label>
				<select name="due">
					<optgroup label="---

SELECT---">						
					<option>JAN</option>	
					<option>FEB</option>		
                                        <option>MAC</option>		
                                        <option>APR</option>		
                                        <option>MAY</option>		
					<option>JUN</option>		
					<option>JUL</option>
					<option>AUG</option>		
					<option>SEP</option>
					<option>OCT</option>		
					<option>NOV</option>
					<option>DEC</option>		
					</optgroup>
				</select>
			</div>
			<div><label for="type">Category:</label>
				<select name="cate">
					<optgroup label="---

SELECT---">

						

<option>Faks</option>
						

<option>Electricity</option>
						<option>Road 

tax</option>
						<option>Vehicle 

insurance</option>
						

<option>Petrol</option>
						</optgroup>
				</select>
			</div>
		<div><label for="name">Amount:</label></div>
		<div><input type="text" name="amount" 

value="RM"></div>


	<div><label for="name">Specification:</label> <input 

type="text" name="spec" size="50"/></div>
</form>

<h1>Please upload the bill as we may process it as soon as 

possible. Thank You.</h1>

<form enctype="multipart/form-data" action="uploader.php" 

method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" >
<h1>Choose a file to upload:</h1>
<div><label><input name="uploadedfile" type="file" ><input 

type="submit" value="Upload File" ></label>
</div></form>

<br>
<p class="submit"><input type="submit" value="Submit" ></p>
</div>
</body>
</html>
<?
} else {
echo "<h1> Below is the infos you had submitted:</h1>";
echo "<h1>Department:</h1>" .$department.".<br/>";
echo "<h1>Due month:</h1>" .$duemonth.".<br/>";
echo "<h1>Category:</h1>" .$category.".<br/>";
echo "<h1>Amount:</h1>" .$amount.".<br/>";
echo "<h1>Specification:</h1>" .$specification.".<br/>";
echo $f."<br />";
}
?>

Check this and compare it with your script. Oh, btw, you can ignore notices(if you get any!).

nav33n 472 Purple hazed! Team Colleague Featured Poster

Well, If you don't specify the storage engine type, the default is MyISAM. There are different storage engine types.
Here is the detailed description of the storage engines. http://dev.mysql.com/tech-resources/articles/storage-engine/part_1.html

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

-731 !

nav33n 472 Purple hazed! Team Colleague Featured Poster

-729

nav33n 472 Purple hazed! Team Colleague Featured Poster

-727

nav33n 472 Purple hazed! Team Colleague Featured Poster

<div><label>Name:<?php echo $_POST["name"];? ></label><br></div> In this line, you have a whitespace after $_POST["name"];? here > It should have been like ?> .
Turn on error reporting. It will help you identify your errors. If you have access to php.ini file, turn on display_errors. If you don't have access to php.ini file, then, put

ini_set("display_errors","on"); 
error_reporting(E_ALL);

in your script.

Cheers,
Naveen

Edit: More about error_reporting here .

Edit 2: And here is one more error. This line should be echo'ed as well. <h1> Below is the infos you had submitted:</h1> Should have been echo "<h1> Below is the infos you had submitted:</h1>"; Edit 3:

{
echo $f."<br />";
}

What is this for ? This loop don't have a condition ! { } wont do anything.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb RocknRollAnimal :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

-725

nav33n 472 Purple hazed! Team Colleague Featured Poster

Well, I still don't know/understand what is the problem in using the header function.

if(true){
header("location: true.php");
} else if(false) {
header("location: false.php");
} else {
 header("location: unknown.php");
}

You can have multiple header function depending upon the result.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Do you know if I am using the function "$test = mysql_fetch_array" how would I access a variable in that funciton (test["people"]that would give me the value stored in the table as 4.jpg? )

Yep. When you fetch a record from mysql table using mysql_fetch_array, the record will be returned as an array and will be stored in whatever variable you use. $test = mysql_fetch_array($result) will make $test store the array returned by $result. So, you can access that particular array element by specifying the column name,like, $test.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Say for example, I upload 5 images(1,2,3,4,5 .jpg) to the database. So, there will be 5 entries in the table with the peopleid, imagename, etc.
So, If I want to delete an image, say, 4.jpg, I can do it this way.

$image_to_delete = "4.jpg";
$peopleid = my_user_id ;
$path_of_the_image = "people/".$peopleid."/".$image_to_delete;
if(file_exists($path_of_the_image)){
 unlink($path_of_the_image);
} else {
echo "File doesn't exist! ";
}

A simple example.

nav33n 472 Purple hazed! Team Colleague Featured Poster

-722

nav33n 472 Purple hazed! Team Colleague Featured Poster

I don't think its possible. When you set a cookie, setcookie expects parameter 1 and paramter 2 to be a string and not an array.

http://in2.php.net/setcookie Look at example 3 !

You may also set array cookies by using array notation in the cookie name. This has the effect of setting as many cookies as you have array elements, but when the cookie is received by your script, the values are all placed in an array with the cookie's name

nav33n 472 Purple hazed! Team Colleague Featured Poster

well. just example
if 1 member open new thread,
i and you nav33n
reply in same time
hwo come first???
you or me?

Depends on the timestamp. If you reply first, your post will come first ! And I don't know how this will change if a new member(girl) opens a thread !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb Mattew :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

huh! How is this question (?) related to php ? And what does it even mean ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

-720

nav33n 472 Purple hazed! Team Colleague Featured Poster

tin
ton
can

Rampage

nav33n 472 Purple hazed! Team Colleague Featured Poster

-717

nav33n 472 Purple hazed! Team Colleague Featured Poster

Well, these people have already told you which one is better and why. Here are my 2 cents. The maintenance of a php site is much cheaper than a asp.net site. (1st advantage for your client). The web hosting is also cheaper for php when compared to asp.net (2nd advantage for your client!). When it comes to security, you can't really say which one is secure. It all depends on how the script is written.

I wouldn't say ASP.net is bad. Asp.net is good with alot of built-in features and more advanced than php(eg. writing pdf's is pretty easy in asp.net, but in php, you know how difficult it is!) and the availability of hashmaps, etc.. But php is catching up!

When we compare the overall speed, php is much faster than asp.net. :)

php is as good as asp.net and its widely used(because 1. open source 2. cheap maintenance and cost). Why don't you ask your client to go and find someone else.(if you hate him so much!) :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) Cool ! congrats !

nav33n 472 Purple hazed! Team Colleague Featured Poster
<?php
$x=1;
if($x==1) { $disabled="disabled=true"; } else { $disabled="disabled=false"; }
echo "<Input type='button' name='button' value='button' $disabled >";
?>

:) Like this ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Ok! In simple terms, You have this query. $query = "SELECT * FROM table $limit"; Just add another line, echo $query after it. It will print something on the screen. Copy it and paste it in phpmyadmin or mysql console. If your query is correct, you will get an output. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

No. Print the query.Execute it.

$query = "select * from tutorials $limit";
echo $query;
nav33n 472 Purple hazed! Team Colleague Featured Poster

Well, you can put the where clause in the condition. If it satisfies the condition, print it. Else dont !
Eg.

if ($condition){
$where = "where x='$x' and y='$y'";
} else {
$where = "";
}
$query = "select * from table $where"; //it will have where clause only if the condition is satisfied. Else where will be null and it wont affect the query!
nav33n 472 Purple hazed! Team Colleague Featured Poster

:) You are welcome!