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

Welcome to Daniweb! You have a very long name :P

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) Welcome to Daniweb!

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

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb Gimmick! lol..nice nickname!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb coffeepot !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

boot
noob
toon

Statement

nav33n 472 Purple hazed! Team Colleague Featured Poster

Go to hell and make that your home.

nav33n 472 Purple hazed! Team Colleague Featured Poster

-676

nav33n 472 Purple hazed! Team Colleague Featured Poster

That means you have an echo statemtn of a html tag before session_start(); .

and it'll not displaying the captcha image..

Check this script. Maybe it isn't doing its job.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Why do you need the stuff in red?

In php, if we want to echo something, its done like this. echo "Welcome...";

Sulley's Boo commented: "You don't have to" ..... give me a rep back whenever i give you one :P mote me tera khoooooon bahaadungiiiii baliiii ke bakre. AND, Slapping is fun. +4
iamthwee commented: Boo is right, you take what she says toooo seriously. She was just being playful. Lighten up. +13
nav33n 472 Purple hazed! Team Colleague Featured Poster

when i placed the mysql_error() then it showed

No. mysql_error() shows mysql related error. Can you post your full code ? May be you have a misplaced } .
And instead of

while (list($id, $topic, $event, $date) =mysql_fetch_array($result))

try this

while($row=mysql_fetch_array($result)){ $id=$row['id']; 
$topic=$row['topic'];
$event=$row['event'];
$date=$row['date'];
...

I am not sure if this ll work. If it doesn't, then please post your code.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Open php.ini and search for display_errors. If its off, turn it On. Then look for error_reporting. Uncomment this line. error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT .
Or, add ini_set("display_errors","On"); error_reporting(E_ALL); in your script.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Lunch.

Php or Java ?

Sulley's Boo commented: You don't have to. +4
nav33n 472 Purple hazed! Team Colleague Featured Poster

That's strange! do you have error_reporting turned on on your local system ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

That wouldn't fix anything. There is a } at the end which is for 'for loop'. You just closed the 'for loop' after 'if loop'. That would generate an error

Parse error: syntax error, unexpected T_ELSE

:)

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) I ran your script and I didn't get any error. Maybe you are getting the error because there is no space after

if(!isset($_SESSION)){session_register('captcha');}

Replace this line by this.

if(!isset($_SESSION['captcha'])){ session_register('captcha'); }

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

$query = "SELECT id, topic, event, date
FROM events ORDER BY 'id' DESC LIMIT 5";

Should be

$query = "SELECT id, topic, event, date
FROM events ORDER BY id DESC LIMIT 5";

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

hmm.. Check this . It might be of some help.

nav33n 472 Purple hazed! Team Colleague Featured Poster

when the user logs in, put his username in the session. In all other pages, check if $_SESSION is set and not equal to null. If its null, then use header function to redirect to the login page.
Eg.

//after user logs in, 
$_SESSION['username']=$username;
// 
in other pages, 
if(! isset($_SESSION['username']) || $_SESSION['username']=="")) {
//redirect to login page
}

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

Can you log in with 'root' account ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) ah! ok.

nav33n 472 Purple hazed! Team Colleague Featured Poster

No probs! I just felt like reporting it and so I did. Thanks for the quick reply! :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

or on the php.ini file which you upload to the directory enter this command:

safe_mode = Off

:) You bumped into a 2 year old dead thread.

nav33n 472 Purple hazed! Team Colleague Featured Poster

url has slashes which should be stripped or escaped. Check addslashes .

nav33n 472 Purple hazed! Team Colleague Featured Poster

I know! well, I just thought if we had a uniform menu, it would have been better. But anyway, thanks.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm.. I am not aware of it.

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) you are welcome.

nav33n 472 Purple hazed! Team Colleague Featured Poster

concat(firstname,lastname) as name More on concat here.

nav33n 472 Purple hazed! Team Colleague Featured Poster

I think you can do it. Check this out. Check the working demo at the end of the page.

nav33n 472 Purple hazed! Team Colleague Featured Poster

look at the date before bumping an old thread. :) Thanks.

nav33n 472 Purple hazed! Team Colleague Featured Poster
if(isset($_POST['team']))
{ 
	foreach($_POST['team'] as $value)
	{
	$insert="INSERT INTO team('team')VALUES ('$value')";
	echo "$insert<br>";
	}
}

are you want to do like this???

I guess you didn't read all the posts.

nav33n 472 Purple hazed! Team Colleague Featured Poster

It was a scary sight !

nav33n 472 Purple hazed! Team Colleague Featured Poster
<?php
$conn=mysql_connect("localhost","root");
mysql_select_db("test");
$operation=$_POST['operation'];
$id=$_POST['id'];
if(isset($_POST['submit'])) {
		$team=implode(",",$_POST['team']);
		$name=$_POST['name'];
		$q="insert into table1 (name, team) values ('$name','$team')";
		mysql_query($q);
}
if($operation=="delete"){
	$q="delete from table1 where counter='$id'";
	mysql_query($q);
}
if(isset($_POST['update'])){
	$name=$_POST['name'];
	$team=implode(",",$_POST['team']);
	$q="update table1 set name='$name', team='$team' where counter='$id'";
	mysql_query($q);
}
?>
<html>
<body>
<form method="post" name="insertform" action="checkbox1.php">
Enter name: <input type="text" name="name" /><br />
<input type="checkbox" name="team[]" value="AG">Argentina <br />
<input type="checkbox" name="team[]" value="BR">Brazil <br />
<input type="checkbox" name="team[]" value="GE">Germany <br />
<input type="checkbox" name="team[]" value="EN">England <br />
<input type="submit" name="submit" value="submit">
</form>
<hr>
<form method="post" name="editform" action="checkbox1.php">
<input type="hidden" name="id">
<input type="hidden" name="operation">
<?php
	$q="select counter,name from table1";
	$result=mysql_query($q);
	while($row=mysql_fetch_array($result)){
		$name=$row['name'];
		$id=$row['counter'];
		echo $name ."<input type=\"button\" name=\"edit\" value=\"edit\" onclick=\"javascript: document.editform.operation.value='edit';document.editform.id.value='$id';document.editform.submit();\"><input type=\"button\" name=\"delete\" value=\"Delete\" onclick=\"javascript: document.editform.operation.value='delete';document.editform.id.value='$id'; document.editform.submit();\"><br />";
	}
?>
</form>
<hr>
<?php
if($operation=="edit") {
	$id=$_POST['id'];
	?>
	<form method="post" name="updateform" action="checkbox1.php">
	<input type="hidden" name="id" value="<?php echo $id; ?>">
	<?php
	$q="select * from table1 where counter='$id'";
	$result=mysql_query($q);
	$row=mysql_fetch_array($result);
	$name=$row['name'];
	$team=$row['team'];
	$teamarray=explode(",",$team);
	echo "<input type=\"text\" name=\"name\" value=\"$name\"><br />";
?>
<input type="checkbox" name="team[]" value="AG" <?php if(in_array("AG",$teamarray)){ echo "checked"; } ?>>Argentina <br />
<input type="checkbox" name="team[]" value="BR" <?php if(in_array("BR",$teamarray)){ echo "checked"; } ?>>Brazil <br />
<input type="checkbox" name="team[]" value="GE" <?php if(in_array("GE",$teamarray)){ echo "checked"; } ?>>Germany <br />
<input type="checkbox" name="team[]" value="EN" <?php if(in_array("EN",$teamarray)){ echo "checked"; } ?>>England <br />
<input type="submit" name="update" value="update">
<?php
}
?>
</body>
</html>

Well, Here is the code. The code is lil confusing (and untidy) but I am in no mood to write any better code. I am doing everything in 1 page. You can insert, edit and delete a record. …

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hey Drenalin! Welcome to Daniweb! :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm.. maybe because you have privileges to Area 51 ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hi, Sorry. I didn't get it. Could you please re-explain the whole thing to me ? Is it like this.
You have a textbox to enter the name, list of checkboxes to select the country and a submit button. You can add records to the table from this screen. You need another screen where you can edit the records in the table ? (change the name and checkbox values ?) Is this what you are asking ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hello,

The dropdown menus doesn't work here and here . I tried it in FF as well as IE6. Is it possibly a bug ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Stairs


Stars or moon ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

mass
mess
save

Encapsulate

nav33n 472 Purple hazed! Team Colleague Featured Poster

failed

nav33n 472 Purple hazed! Team Colleague Featured Poster

-661

nav33n 472 Purple hazed! Team Colleague Featured Poster

Does anyone know a food-addicted person?

I know many. Every kid loves junk food these days.

nav33n 472 Purple hazed! Team Colleague Featured Poster

What data ? Print out your query. What does it print ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Print out what's in $target_path. while adding $target_path to the table, instead of inserting $target_path, do this. $target_path=addslashes($target_path); and then insert.