cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Then you would need to do something like

if ($_POST['val']!='0' && $_POST['val']!=0) {
$q="SELECT sum(credits) FROM courses WHERE course_code='$val'";
if ($result2=mysql_query($q))
$count2= mysql_num_rows($result2);		
$row = mysql_fetch_row($result2);
$first=$row[0];
} else {
$first=0;
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I received your pm and try the following

<html>
<body>
<form action="login.php" method="post">
<div>
<table width="100%">
<tr>
<td><img src="Logofinalcopy.gif"></td>
</tr>
<tr>
<td bgcolor="aqua"><h2>Login</h2></td>
</tr></table>
<table align="right" style="width:40%">
<br>
<tr>
<td>Username:</td>
<td><input type="text" name="username"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="password"></td>
</tr>
<tr>
<td align="CENTER" COLSPAN="4">
<input TYPE="SUBMIT" name="submit" value="Login">
<input TYPE="reset" name="submit" value="clear"></td>
</tr>
</table>
</div>
</form>
</body>
</html>
<?php
if(isset($_POST['submit']))
{
$con = mysql_connect("10.70.1.50","invensis","invensis", true);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$con=mysql_select_db("database_myproject", $con);
if (!$con)
{
die('Could not connect DB: ' . mysql_error());
}

$username=$_POST['username'];
$password=$_POST['password'];
$Username = stripslashes($username);
$Password = stripslashes($password);
$Username = mysql_real_escape_string($username);
$Password = mysql_real_escape_string($password);
$flag="OK";
$msg="";
if(strlen($Username) < 1)
{
$msg=$msg."Please enter the username<br>";
$flag="NOTOK";
}
if(strlen($Password) < 1)
{
$msg=$msg."Please enter the password<br>";
$flag="NOTOK";
}
if($flag <>"OK")
{
echo "<br><br><br><br><br><strong style='color:#FF3333'>"."<right>Please enter Username/Password <br></right>"."</strong>"; }
else
{
$sql="SELECT * FROM `Users` WHERE `Username`='$Username' and `Password`='$Password'";
$result=mysql_query($sql, $con);
if(!$result)
{
    echo mysql_error();
}
$count=mysql_num_rows($result);
if($count==1)
{
$sql = "SELECT Role FROM Users WHERE Username='$Username' and Password='$Password'";
$result = mysql_query($sql, $con);
$info = mysql_fetch_array($result);


if($info['Role']== '0')
{
@header("location: http://localhost/Project/Superadmin.php");
}
else if($info['Role']== '1')
{
@header("location: http://localhost/Project/Admin.php");
}
else if($info['Role']== '2')
{
@header("location: http://localhost/Project/User.php");
}


}
else
{
echo "<br><br><br><br><br><strong style='color:#FF3333'><left>Incorrect UserName OR Password</left></strong>";
}

}
}
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I have adjusted your code but it is mainly invalid variables. Below is a patched up version of your code but still needs a little improvement as some variables don't exist.

<?php 
include_once "scripts/connect_to_mysql.php";
include("db.php");//Connect to Database
include("tolink.php");

//Insert mysql connections here

$r=mysql_query('SELECT * FROM comments, messages WHERE comments.msg_id_fk = messages.msg_id ORDER BY comments.com_id, messages.msg_id') or die(mysql_error());
$messagedump='';
while ($row = mysql_fetch_assoc($r)) {


$idt=$row['msg_id'];//Message id
$msg=$row['message'];//The Message
$useron=$row['username'];//This is the user where the message is posted on
$date=$row['date'];//Message date
//$msg=toLink($msg);
$id2=$row['com_id'];//Comment id
$comment=$row['comment'];//The Comment 
$date2=$row['_date'];//Comment date
$usernameqw=$row['_username'];//User who posted the comment


if ($messagedump!=$msg) {
	$messagedump=$msg;

$display .='
<li class="bar'.$idt.'"  onmouseover=\'document.getElementById("'.$idt.'").style.display="";\' onMouseout=\'document.getElementById("'.$idt.'").style.display="none";\'>
<div>
<div align="left" class="post_box">

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top" width="60px">'.$user_picpost.'</td>
    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top"><a href="#" class="comment"><font style=" font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#333333;"><b>'.$useron.'</b></font></a>&nbsp;<font style=" font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#333333;">'.$msg.'</font></td>
  </tr>
</table>
</td>
    <td valign="top" width="19px" align="right">
<div id="hide_edit_btn" ><span style="display:none;" class="'.$idt.'"  id="'.$idt.'"><a href="javascript<b></b>: void(0)" id="'.$idt.'" >';

$display.= ($useron == $username || $usernameqw == $username) ? "<div class=\"hover_delete\">&nbsp;</div>" : "";
$display.= '</a></span></div>
	</td>
  </tr>
</table>
</div>

<div id="expand_box">
<div id="expand_url"></div>
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="65px">&nbsp;</td>
    <td align="left"><span class="feed_link"><font style=" font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#606060;">'.$date.'  
	</font>
	';
$display.= ($username !=="") ? "&nbsp;-&nbsp;" : "";
$display.= '<a href="#" class="comment" id="'.$idt.'" title="Click here to comment"><font style=" font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#333333;">';
$display.= ($username !=="") ? "comment" : "";
$display.= '</font></a></span></td>
  </tr>
</table>
';
}

$display .='
<div class="comment_load" id="comment'.$id2.'" >
 <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top" align="left" width="32px">'.$user_pic2post3.'</td>
<td valign="top"> …
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I received your pm and try the following:

<html>
<body>
<form action="login.php" method="post">
<div>
<table width="100%">
<tr>
<td><img src="Logofinalcopy.gif"></td>
</tr>
<tr>
<td bgcolor="aqua"><h2>Login</h2></td>
</tr></table>
<table align="right" style="width:40%">
<br>
<tr>
<td>Username:</td>
<td><input type="text" name="username"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="password"></td>
</tr>
<tr>
<td align="CENTER" COLSPAN="4">
<input TYPE="SUBMIT" name="submit" value="Login">
<input TYPE="reset" name="submit" value="clear"></td>
</tr>
</table>
</div>
</form>
</body>
</html>
<?php
if(isset($_POST['submit']))
{
$con = mysql_connect("10.70.1.50","invensis","invensis", true);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$select=mysql_select_db("database_myproject", $con);
if (!$select)
{
die('Could not connect DB: ' . mysql_error());
}

$username=$_POST['username'];
$password=$_POST['password'];
$Username = stripslashes($username);
$Password = stripslashes($password);
$Username = mysql_real_escape_string($username);
$Password = mysql_real_escape_string($password);
$flag="OK";
$msg="";
if(strlen($Username) < 1)
{
$msg=$msg."Please enter the username<br>";
$flag="NOTOK";
}
if(strlen($Password) < 1)
{
$msg=$msg."Please enter the password<br>";
$flag="NOTOK";
}
if($flag <>"OK")
{
echo "<br><br><br><br><br><strong style='color:#FF3333'>"."<right>Please enter Username/Password <br></right>"."</strong>"; }
else
{
$sql="SELECT * FROM `Users` WHERE `Username`='$Username' and `Password`='$Password'";
$result=mysql_query($sql, $con) ;
if(!$result)
{
    echo mysql_error();
}
$count=mysql_num_rows($result);
if($count==1)
{
$sql = "SELECT Role FROM Users WHERE Username='$Username' and Password='$Password'";
$result = mysql_query($sql, $con);
$info = mysql_fetch_array($result);


if($info['Role']== '0')
{
@header("location: http://localhost/Project/Superadmin.php");
}
else if($info['Role']== '1')
{
@header("location: http://localhost/Project/Admin.php");
}
else if($info['Role']== '2')
{
@header("location: http://localhost/Project/User.php");
}


}
else
{
echo "<br><br><br><br><br><strong style='color:#FF3333'><left>Incorrect UserName OR Password</left></strong>";
}

}
}
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Your sql syntax should be as follows

$sql="SELECT * FROM `Users` WHERE `Username`='$Username' and `Password`='$Password'";

Notice the change in quotes. I would give you a line number but you didn't use code tags so I can't.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

If you want could you incorarate yor code into mine without heredoc.
I tried but it do's not display right.

I could but I would require a html template for the place the php code into. As for how my code works, in the if statement is the message then outside the if statement is the comments.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

For making and reading excel files with php I have always used PHPexcel which is simple to use and effective. Enjoy.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Perhaps try the following as simular as it might look.

<?php
//Insert mysql connections here

$r=mysql_query('SELECT * FROM `comments`, `messages` WHERE `comments`.`msg_id_fk` = `messages`.`msg_id` ORDER BY `comments`.`com_id`, `messages`.`msg_id`') or die(mysql_error());
$messagedump='';
while ($row = mysql_fetch_assoc($r)) {
if ($messagedump!=$row['message']) {
$messagedump=$row['message'];
echo <<< HTML
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>{$row['username']}</td>
    <td>{$row['message']}</td>
  </tr>
  <tr>
    <td>{$row['date']}</td>
    <td>nbsp;</td>
  </tr>
</table></td>
  </tr>
HTML;
}

echo <<< HTML
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>{$row['_username']}</td>
    <td>{$row['comment']}</td>
  </tr>
  <tr>
    <td>{$row['_date']}</td>
    <td>&nbsp;</td>
  </tr>
</table></td>
  </tr>
</table>
HTML;

}
?>

The bug was $messagedump wasn't being assigned a value.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Anybody Please?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The usual procedure on daniweb is that each time you encounter a problem you post your problem and people try and fix it but if you like I can teach you the basics to php via msn at msn@cwarn23.info
That way you can learn live and faster.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I need it to display all the messages for that user and inside ever message display every comment for that message
I'm gonna post my code so you can see what i'm talking about

That's what my previous code does. It displays a message then below that all of the comments for that message then goes to the next message. So could you expand on why it doesn't work as the code I posted should do everything you asked in the above quote.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Or $25 for 6 months :P

I would say that paying is better than ABP or NoScript. Makes you feel good :D Unlike ABP which makes me feel like I am stealing...

Or for about 2 cents an hour you can be ad free. That is if daniweb offered such a smaller price.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I prefer php as asp is so overly complex and poorly designed. Asp reminds me too much of Basic and as I am a Fop believer (Function Oriented Programming) I much prefer php.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

This comes down to design. If you are using mysql then you should be able to use the where clause to select so that for example SELECT * FROM `table` WHERE `club`="A" Then all you need to do is store in a session what club the user is in and place that club into the where clause each time.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

<?php echo "Hellow World"; ?>

is the same as:

<?= "Hello World" ?>

Except <?= "Hello World" ?> is depreciated.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Below is an example of how to do so.

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to, $subject, $message, $headers);
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Below is the code and you will need to rename the username and date columns in the comments table to _username and _date

<?php
//Insert mysql connections here

$r=mysql_query('SELECT * FROM `comments`, `messages` WHERE `comments`.`msg_id_fk` = `messages`.`msg_id` ORDER BY `comments`.`com_id`, `messages`.`msg_id`') or die(mysql_error());
$messagedump='';
while ($row = mysql_fetch_assoc($r)) {
if ($messagedump!=$row['message']) {

echo <<< HTML
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>{$row['username']}</td>
    <td>{$row['message']}</td>
  </tr>
  <tr>
    <td>{$row['date']}</td>
    <td>nbsp;</td>
  </tr>
</table></td>
  </tr>
HTML;
}

echo <<< HTML
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>{$row['_username']}</td>
    <td>{$row['comment']}</td>
  </tr>
  <tr>
    <td>{$row['_date']}</td>
    <td>&nbsp;</td>
  </tr>
</table></td>
  </tr>
</table>
HTML;

}
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

If your commented line 53 was the bug then try the following.

<?
//dim $DataConn, $cmdDC, $rsDC;
//dim $Item, $strVendorType;
//dim $iFieldCount, $iLoopVar;
 
$strVendorType = @$_GET["VendorType"];
//If strVendorType = "" Then strVendorType = "Miscellaneous"
//Response.write "user selected " & strVendorType & "<br>"
 
// Finally we've got all our info, now to the cool stuff
// Create and establish data connection
Set $DataConn = Server.CreateObject("ADODB.Connection");
$DataConn.ConnectionTimeout = 15;
$DataConn.$CommandTimeout = 30;
 
//Access connection code
$DataConn.$Open "DBQ=".Server.MapPath("database.mdb").";Driver={Microsoft Access Driver (*.mdb)}";
 
// Create and link command object to data connection then set attributes and SQL query
Set $cmdDC = Server.CreateObject("ADODB.Command");
$cmdDC.$ActiveConnection = $DataConn;
$cmdDC.$CommandText = "SELECT * FROM Vendors WHERE (VendorType = '".$strVendorType."');";
//Response.write cmdDC.CommandText
$cmdDC.$CommandType = 1;
 
// Create recordset and retrieve values using command object
Set $rsDC = Server.CreateObject("ADODB.Recordset");
// Opening record set with a forward-only cursor (the 0) and in read-only mode (the 1)
$rsDC.$Open $cmdDC, , 0, 1;
?>
 
<span class="bodyText"><B>Results of search for :: <?= $strVendorType ?> </B>
<hr size=1 noshade><p>
<?	Do While Not $rsDC.$EOF;
		echo "<b>Company: </b>".$rsDC["CompanyName"];
		echo " (".$rsDC["VendorType"].")<br>";
		echo "<b>City: </b>".$rsDC["City"]."<br>";
		echo "<b>State: </b>".$rsDC["ST"]."<br>";
		echo "<b>Address: </b>".$rsDC["Address"]."<br>";
		echo "<b>ZIP: </b>".$rsDC["Zip"]."<br>";
		echo "<b>Country: </b>".$rsDC["Country"]."<br>";
		echo "<b>Vendor Type: </b>".$rsDC["VendorType"]."<br>";
		echo "<b>URL: </b>"."<a href=http://www.".$rsDC["URL"]." target=_blank>"."<b>".$rsDC["URL"]."</b></a>"."<br>";
		echo "<b>Salutation: </b>".$rsDC["Salutation"]."<br>";
		echo "<b>First Name: </b>".$rsDC["FirstName"]."<br>";
		echo "<b>Last Name </b>".$rsDC["LastName"]."<br>";
		echo "<b>Professional Title: </b>".$rsDC["ProfessionalTitle"]."<br>";
		echo "<b>E-mail Address: </b>"."<a href=mailto:".$rsDC["EmailAddress"].">"."<b>".$rsDC["EmailAddress"]."</b></a>"."<br>";
		echo "<b>Main Phone: </b>".$rsDC["PhoneMain"]."<br>";
		echo "<b>Direct Phone: </b>".$rsDC["PhoneDirect"]."<br>";
		echo "<b>Fax Number: </b>".$rsDC["FaxNumber"]."<br>";
		echo "<b>Mobile Phone: </b>".$rsDC["PhoneMobile"]."<br>";
		Response.Write "<b>Account Info.: </b>" & rsDC("AccountInfo") & "<br>";
		echo "<b>Payment Type: </b>".$rsDC["PaymentType"]."<br>";
		echo "<b>Notes: …
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Do you want me to send you my whole code?

it works
but when i try adding it to my code it don't work

Then send a html template of what the result should look like (but with the echoed data) Then I will place in there the php code. Just mark in the template which $row variable goes where.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Are there any errors or could you explain what is happening so I can fix.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Then try the following:

$r=mysql_query('SELECT * FROM `comments`, `messages` WHERE `comments`.`msg_id_fk` = `messages`.`msg_id` ORDER BY `comments`.`com_id`, `messages`.`msg_id`') or die(mysql_error());
$messagedump='';
while ($row = mysql_fetch_assoc($r)) {
if ($messagedump!=$row['message']) {
$messagedump=$row['message'];
echo '<hr>';
echo $row['message'];
}
echo '<br><br>';
echo $row['comment'];
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

To elaborate on that Below are three examples of doing the same thing

<?="Hello World!"; ?>
<? echo "Hello World!"; ?>
<?php echo "Hello World!"; ?>

Now as you should know they all do the same thing providing php is configured correctly. However as of Php 5.3.0 in xampp the <? command is depreciated and instead you must use the <?php method. This means by default you would need to use the echo statement unless you go into the php.ini settings and enable short tags. But then as of Php 6.0 short tags are completely removed from php making it impossible to enable it again. So if you wish for your code to be compatible and php 6 compliant then the only option is to use the following method.

<?php echo "Hello World!"; ?>

Now a lot of people reading this might say wtf php 6 hasn't been released yet. Well php 6 has been documented at the php.net website and the expectations of php 6 have already been released but not the C/C++ code itself.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Could you tell us what the $type variable contains as it may contain an invalid type header.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

So this will display all the comments for each message

Yes but when just rereading your first post I found the code should be more like the following:

$r=mysql_query('SELECT * FROM `comments`, `messages` WHERE `comments`.`msg_id_fk` = `messages`.`msg_id` ORDER BY `comments`.`com_id`, `messages`.`msg_id`') or die(mysql_error());
while ($row = mysql_fetch_assoc($r)) {
echo $row['comment'];
echo '<br><br>';
echo $row['message'];
echo '<hr>';
}

I would suggest trying it and see if it works.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The classic question with no code. I would like to try and debug it but can't see any code to debug. Could you please post your code and your errors so that we at least have a chance of solving this.

Hey Everyone,

I am getting an error with a PHP script made using the Authorize.net AIM (Advanced Integration Method) API for my donation form. I have gone over the code dozens of times and still do not know why it is not working. Everything works except the most important part...it will not process the credit card. I would like to know if anyone would mind looking over my code for a debug? If you are willing to but need to be compensated please give a link to your portfolio. Thank you

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

$r=mysql_query('SELECT * FROM `comments`, `messages` WHERE `comments`.`msg_id_fk` = `messages`.`msg_id`') or die(mysql_error());
while ($row = mysql_fetch_assoc($r)) {
echo $row['comment'];
echo '<br><br>';
echo $row['message'];
echo '<hr>';
}

I think that is what you mean but I haven't tested it for bugs.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Javascript and ajax are mixed together in the same script so basically javascript allows for user interaction for things like menus, validating client side, where as ajax is a lot like javascript but allows server interaction with javascript. As for Java, you would use java for things like the login form, forms that need to be secure, chat boxes and anything that is really really fancy as Java can also interact with the server. Also you will find with netbeans that there is an option where you can use drag and drop commands to create the interface. Even for applets.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

That's a great one. lol

You mean "yes" I do not create movies. When you say "no I do not", that means you do -- two negatives make a positive :)

"Yes, we have no banannas .."

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Actually, I'm quite pleased with my current laptop, although I wish Windows 7 loaded faster.

On the other hand, I don't play games on my computer, I stick to consoles.

You mean you don't compile code and you don't create movies or anything.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

worry about currun world man... dont get over active and avoid foolishness because ur b'day is coming april 1........ so pray to god to giv u good brain

What happens on apral 1st. Is it end of the world or the day I need to use my brain?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi and welcome to daniweb. Let me be the first to say please use code tags. Also as for your scripts problem, I am guessing the exif module or mime type module is not installed on your Linux server. So check that required modules are installed by using <?php phpinfo(); ?> and see if your required modules are in that list. Also please post any errors that appear.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi, we all know we would love to have more ram or more graphics but if you could decide the specs even if such specs don't exist yet what would they be. So for example, I think my computer with 4GB of ram is terribly slow so below are the specs of my dream computer.
Ram: 8PB (Peta-bytes)
Graphics: 512TB (Terra-bytes)
Hard drive: 256PB (Peta-bytes)
Operating system: Linux

And your dream computer...

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I like regular cerial (code) for breakfast with milk.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The programs you require are notepad++ which is a great text editor with a syntax highlighter and for testing use wamp localhost server. Also for java apps netbeans is an easy to use app maker. As for which languages you require they are javascript, java, php, ajax, html and css.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Got it working..
I changed it to..

if (!isset($_SESSION['phone']) || isset($_POST['txt_phone'])) {
	$_SESSION['phone'] = $_POST['txt_phone'];
}

With that if condition you minus well remove the if condition as it will allways pass.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the link below which contains both a text and video tutorial. Also I would like your comments on how helpful it is.
http://syntax.cwarn23.net/PHP/Pagination_made_easy

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Sounds like a bit heavy for just enabling / disabling another box.

Well if you want to populate information into a div box using data from another file or database after the page has loaded then ajax would be required as javascript does not have that functionality. If however it is to just hide and show the data again then you can use a mixture of javascript and css.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I guess "No". The function you want to achieve is in the browser (purely client side). So it must be done at the client which means Javascript or some other client side language. But Javascript is probably the easiest one and the one which works across most browsers.

While that is true there is a thing called ajax. I would suggest following an ajax tutorial where javascript can communicate with php after the page has loaded.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Where you use $_SESSION[blah]=$_POST you should place that in an if statement like the following.

if (isset($_POST) && !empty($_POST)) {
$_SESSION['blah']=$_POST['blah'];
$_SESSION['asdf']=$_POST['asdf'];
}

This way if $_POST is empty, session will not be assigned an empty value.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

how can i use if conditon in it...

Like the following

RewriteCond %{REQUEST_URI} test/withregex/index\.php
#something to do here

Where as the first line is the if condition and the second line is what to do if it passes.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

do i have to pass all that through GET method ?
is it possible to get that variables through another method ?

Well other options include sessions and cookies. If you don't want that in the url then I would suggest using cookies. To use cookies place the following at the very top of every page.

setcookie('yummy',$_SERVER['REQUEST_URI'],time()+(60*60*24));

Then your redirect will be as follows.

$login_status=true;
if ($login_status==true) {
header('Location: http://yoursite.com'.$_COOKIE['yummy']); //no ending slash
}

Hope that helps...
---------------
For the Gurus:
Note that the php http referer is not always accurate as many browsers including my own do not send that information. Instead the http referer as mentioned in previous posts will at times be an empty string. That is why I suggest using the above method.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster
RewriteCond %{REQUEST_URI} test/withregex/index\.php
#something to do here
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Below is a nice tutorial for Ubuntu and its partner operation system Debian.
http://www.howtoforge.com/apache2_with_php5_and_php4

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

how to restrict if a particular url came , some of the condition that should not to execute...

So you want to check if the url is a specific location? Is that correct? Also I have found a nice tutorial for you at http://corz.org/serv/tricks/htaccess2.php

logonchristy commented: nice +1
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

There is a special way of doing it and is totally different to the php if statement. But the way you do it varies depending on what the condition is. Could you tell us what you are trying to test/check/ifcheck.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Like the following:

function truehash($hashzzz) {
return hash('sha256','asdfedcg$#!@123lkjhg'.hash('whirlpool',$hashzzz).'1!q');
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

So I'm using InnoDB and so far it is ok and I will see when I have to restart the mysql service. Because hopefully if it is inserting a record while the mysql service is restarting it shouldn't corrupt the table like myisam does. That is still to be tested. But as for now, I will ask appart from obvious performance what is the difference between InnoDB and Myisam? And yes I read the earlier posts but some of those long words are confusing.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

It is simple really. When you link you include the url of that page in that link. So for example:

<?php
echo '<a href="anotherpage.php?previouspage='.urlencode($_SERVER['REQUEST_URI']).'">Test link</a>';
?>

Then anotherpage.php

$login_status=true;
if ($login_status==true) {
header('Location: http://yoursite.com'.$_GET['previouspage']); //no ending slash
}

I have a same question..but i didnt got in this solution..can you please explain it..?

Thanks..

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

When redirecting them in the first place add into the redirect url "login.php?url=".urlencode(/path/to/page/from.php); Then on the form you place in the action= parameter the above path which is now in the $_GET tag.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi and I have a mysql table that gets a few million records inserted per day and it seems to get corrupted very often. The current database structure is myisam but it keeps on getting corrupted. Are there any mysql data structures that won't corrupt even when restarting the mysql service while a record is being inserted? BTW I only need to insert and select records and needs to be fast at selecting from the database too. Please help. Thanks.