nav33n 472 Purple hazed! Team Colleague Featured Poster

-540

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hello C41R0 ! Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Right. But you aren't unsetting the session variable. You should destroy the session first and then redirect ! Because, the user will be 'logged in' when he clicks on logout. So, it wouldn't enter the if condition. You can unset registered session variable first using session_unset and then redirect to the main page.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm.. Did it solve your problem ? And yep! dont give the absolute path. If you host this site some day, you should search for localhost in your script and change it to the url. So, its better if you give relative path of the file.

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

Oh btw, you cant give localhost. You should give the relative path. For example, if your executing script is in webpaos and you want to redirect the user to admin/index.php, you can do it this way. header("location: ./admin/index.php");

nav33n 472 Purple hazed! Team Colleague Featured Poster

else {
header("location:localhost/webpaos/admin/index.php")

Missing } tag and semi-colon after header. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Some Americans Love African Monkeys, Nerdy Deers, Elephants, Rodents, Snakes. :P

nav33n 472 Purple hazed! Team Colleague Featured Poster

yep.
header("location: $url");
where $url can be
1. A url eg. $url="http://www.yahoo.com";
2. The screen where you want to redirect the user.
Eg. $url="path/to/admin/index.php";

nav33n 472 Purple hazed! Team Colleague Featured Poster

:S oh!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Using menus ? If a user is valid, redirect him to the next page which has a menu to navigate to all the pages. You can use the same header function to redirect the user after successful login.

<?
// Check if session is not registered , redirect back to main page.
// Put this code in first line of web page.
session_start();
if(!session_is_registered(myusername)){
header("location:main_login.php");
} else {
header("location: adminpage.php");
}
?>

In adminpage.php, have a menu to navigate to other pages.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Check this link. I dunno if this will solve your problem. But you can give it a try!

nav33n 472 Purple hazed! Team Colleague Featured Poster

As you can see, theres a difference in style and font. As far as I know, most people dont use it !

<b>Note:</b> These tags are often used to display computer/programming code.

Ref: The example in the link provided by you.
Maybe they use it in code examples that you see in many books.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Eighty Nine Zeebras Yelled,"Mother Earth Saves" !

nav33n 472 Purple hazed! Team Colleague Featured Poster

band

nav33n 472 Purple hazed! Team Colleague Featured Poster

lion
sex
noise

Quotation

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Okay! I checked this and even this works. Select * from tables where CREATE_TIME > "2008-02-01" and CREATE_TIME < "2008-02-08" Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

when in doubt check out the mysql manual...

http://dev.mysql.com/doc/refman/4.1/en/date-and-time-functions.html

umm..nowhere in the manual says how to fetch only those records which lies between 2 dates ! :S

nav33n 472 Purple hazed! Team Colleague Featured Poster

I have not checked your query. But this will work.

$query="select * from table where date_column between "2001-01-05" and "2001-01-10";

This will print all the records where the date_column value lies between the first date and the second date.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Your validation is fine. And you can use the same for all 3 files that you want to read.

nav33n 472 Purple hazed! Team Colleague Featured Poster

You are welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb Jane. I guess the problem is with the harddisk. Bad sectors maybe! Cant boot from a disc ? Have you changed the boot order in the bios ? Check this link. . This might be of some help to you !

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hello Washie! Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster
<?php
echo "<table border=1>";
echo "<th bgcolor=\"red\">test</th>";
echo "</table>";
?>

Hope that helps.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Search 3 tables in a single query ? As ryan_vietnow said, you can use joins to join these 3 tables based on a condition and search for the desired fields.

nav33n 472 Purple hazed! Team Colleague Featured Poster

You can search multiple tables this way.

<?php
$conn=mysql_connect("localhost","root");
mysql_select_db("test");
if(isset($_POST['submit'])){
	$value1=$_REQUEST['value1'];
	$value2=$_REQUEST['value2'];
	$query1="select * from table1 where column1 like '%$value1%'";
	$result1=mysql_query($query1);
	while($row1=mysql_fetch_array($result1)){
		// fetch the data for query 1
	}
	$query2="select * from table2 where column1 like '%$value2%'";
	$result2=mysql_query($query2);
	while($row2=mysql_fetch_array($result2)){
		// fetch the data for query 2
	}
}
?>
<html>
<body>
<form method="post" action="test.php">
<input type="text" name="value1"><br />
<input type="text" name="value2"><br />
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>

There are 2 input fields. Whatever the user enters in 1st input field will search table1 and it searches table2 for 2nd input field.
If this is not what you want, then you have to post your code.
Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

Can you show us your code ?

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!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb Pranjali !

nav33n 472 Purple hazed! Team Colleague Featured Poster

IP Guardian is designed to be an easy to use IP filtering system to secure your ASP pages against unauthorized visitors. You simply enter the IP addresses into the program and it does the rest.

Statistics will show you how many times a banned IP has attempted to visit your page.

The next version will feature even more filtering options and include a temporary ban feature.

<snipped>

OP asked this question LONG LONG time ago. Please check the date before bumping an old thread.

nav33n 472 Purple hazed! Team Colleague Featured Poster

you are welcome! :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Remove them and put it after <? tags. Its considered as 'output' if you have it outside <? tag. And if you are using session_start or header function, nothing should be outputted before session_start or header function.

nav33n 472 Purple hazed! Team Colleague Featured Poster
// Check if session is not registered , redirect back to main page.
// Put this code in first line of web page.
<?
session_start();
if(!session_is_registered(myusername)){
header("location:main_login.php");
}
?>

<html>
<body>
Login Successful
</body>
</html>

Do you have the comments outside the <? tag ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

http://sourceforge.net/projects/lams/ I think this is what you are looking for ! But unless you understand how the whole system works, its very difficult to change it as per your needs.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Take a look at this .

nav33n 472 Purple hazed! Team Colleague Featured Poster

Since 'naveen' was already taken and nav33n wasn't, I decided to 'take' it ! Btw, Naveen is my name.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Easiest way would be assign the value of the posted form elements to a variable and then use single quote. Eg.

$name=$_POST['name'];
$city=$_POST['city'];

$query="insert into tablename (name,city) values ('$name','$city')";

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) Good !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Glad that you solved your problem. But still it isnt safe :( Anyways, All the best!

nav33n 472 Purple hazed! Team Colleague Featured Poster

;)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Great. That should get you started. Remember, the file extension should be .php for apache to parse it as a php file. And w3schools will help you learn the basics in no time. You can also refer to php.net.
Its 8 am and I should get some sleep now.. Lol..

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster
<?php
if(isset($_POST['submit'])){
  print_r($_POST);
}
?>
<html>
<body>
<form method="post" action="test.php">
<input type="text" name="name"><br />
<input type="text" name="email"><br />
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>

Click on "toggle plain text" and then copy the code. :) And I meant [ code=php] [ /code] ! < without the whitespace.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Yep. You should have an extension .php for your scripts if you want apache to parse php. Can you show us the script you are using ? (because the code example that I gave you shouldn't give this error!)

nav33n 472 Purple hazed! Team Colleague Featured Poster

hmm. Try this script. Tellme if it works.

<?php
if(isset($_POST['submit'])){
  print_r($_POST);
}
?>
<html>
<body>
<form method="post" action="test.php">
<input type="text" name="name"><br />
<input type="text" name="email"><br />
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>

Call this test.php, put it on your server. Tellme if it works.

nav33n 472 Purple hazed! Team Colleague Featured Poster

No. What I am asking you is, how do you execute your script ? Are you double clicking the file or are you typing the path in the address bar ?
Well, If you want to learn the basics of php, w3schools is the best site to start off.

nav33n 472 Purple hazed! Team Colleague Featured Poster

and if i may add. when i type in the username and password and click on login it. It takes me to localhost/capat/login_check.php and then just produces this

?>

does this help in anyway?

?> ? I guess you have php ending tags somewhere in your html. Anyways, All the best..

nav33n 472 Purple hazed! Team Colleague Featured Poster

umm.. I hope you have started apache service and you are executing your script like, http://localhost/yourfilename.php ? When are you getting that error ? After you submit the page ? What is your url ?
PS. Next time you post your code, please wrap it within [ code=php] [ /code] tags.