fobos 19 Posting Whiz in Training

Here is something you might wanna try.

/**
* Check for correct password
*
* @param string $password The password in plain text
* @param string $hash The stored password hash
*
* @return bool Returns true if the password is correct, false if not.
*/
function check_hash($password, $hash)
{
    if (strlen($password) > 4096)
    {
        // If the password is too huge, we will simply reject it
        // and not let the server try to hash it.
        return false;
    }

    $itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
    if (strlen($hash) == 34)
    {
        return (_hash_crypt_private($password, $hash, $itoa64) === $hash) ? true : false;
    }

    return (md5($password) === $hash) ? true : false;
}
fobos 19 Posting Whiz in Training

Once you hash a password, it cannot be undon. Therefore, you cannot cross check a text password with a hashed one. If this was possible, no password woule be safe on the web.

fobos 19 Posting Whiz in Training

Try
close your first echo with a quote and semi colon

fobos 19 Posting Whiz in Training

The only thing i can think of is, 1) your hardrive is spinning up, and 2) some programs have to get loaded, so its slowing down the time to get to the desktop.

fobos 19 Posting Whiz in Training

Well is the person running this page on his own server? Also, did he change "table1" to what ever the table name is, in the SQL statement?

fobos 19 Posting Whiz in Training

First off you are trying to pass test.php, and you show your add.php, so nothing is going to happen there. Second, in your add.php, you need a connection and an id that gets passed from the ajax function. I would suggest that you get the example from w3shools so you get a basic idea. Its a learning process, but you will get it.

fobos 19 Posting Whiz in Training

This is a really good website that i learned from.

W3Schools

fobos 19 Posting Whiz in Training

I believe because you didnt have

script.onload=scriptLoaded;

on your first post.
you could also include the script

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
    $('#main').click(function(){ alert('hi'); });
})
</script>
fobos 19 Posting Whiz in Training

it looks to me that $checked = a variable with an extra ' in it. It says it in the message (private='0'') with the extra aposrophe. Maybe thats why?

fobos 19 Posting Whiz in Training

yes, since i know php any mysql, i would use that. just display that data on one page have have them echo a link that uses a keyword or id to specifically display the info on that person. Ex

Members.php
<?php
//database connection
// select statement for database

//from w3schools.com with some modding
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("my_db", $con);

$result = mysql_query("SELECT * FROM Persons");

while($row = mysql_fetch_array($result))
  {
  echo "<a href='members2.php?id=".$row['id']."'>".$row['name']."</a>";
  }

mysql_close($con);
?>

Members 2.php
<?php
$id = $_POST['id'];
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("my_db", $con);

$result = mysql_query("SELECT * FROM Persons WHERE id = $id");

//took out while so it doesnt repeat your output.
$row = mysql_fetch_array($result)
?>
  //display the info of what you want to display
 <table><tr><td><?php $row['name'] ?></td></tr></table>
 <?php

mysql_close($con);
?>

Hope this helps

fobos 19 Posting Whiz in Training

you cannot use $result twice. try making one $results and the other $result

fobos 19 Posting Whiz in Training

First off did you set the content as a blob in mysql. Second, go into your http conf file and just like what veedeoo said, change the values to something like that. Third, no need to have a hidden field for the upload size, just have the file upload and a submit button. Fourth, your $query statement needs to change to

mysql_query("INSERT INTO Persons (name, size, type, content)
VALUES ('$fileName', '$fileSize', '$fileType', '$content')");
or
$query = "INSERT INTO Persons (name, size, type, content)
VALUES ('$fileName', '$fileSize', '$fileType', '$content')";

Hope this helps.

fobos 19 Posting Whiz in Training

you can try using the LIKE operator in your mysql statement.

SELECT fields FROM database WHERE field LIKE 'variable'

ex
SELECT lastName, firstName FROM employees WHERE firstName LIKE 'a%'
fobos 19 Posting Whiz in Training

So what is your php problem?

fobos 19 Posting Whiz in Training

Well you are echoing something that either should be wrapped in quotes or need to make it a variable. You have

<td><input type='text' name='<?php echo mark.$y; ?>' id='textfield' /></td>

Possibilities

<td><input type='text' name='<?php echo "mark". $y; ?>' id='textfield' /></td>
<td><input type='text' name='<?php echo "mark $y"; ?>' id='textfield' /></td>
fobos 19 Posting Whiz in Training

So whats your problem?

fobos 19 Posting Whiz in Training

Did you upload the videos to a database, or in a folder?

fobos 19 Posting Whiz in Training

Are you trying to redirect the page with the nested iframe? Basically if you click delete in the iframe, you want it to redirect the main page.

fobos 19 Posting Whiz in Training

Well i was searching around googling the work cosymantecbfw and i think it relates to ' co symantec bfw' for symantec. Are you running any symantec programs?

fobos 19 Posting Whiz in Training

Or you could try something like this.

$("table").css({'background-color': '#ffe', 'border-left': '5px solid #ccc'})
fobos 19 Posting Whiz in Training

Try this. In this case, you already have the errors being posted in the div, so this will scroll to the div with the errors.

<?php
if(isset($_POST["myform"]) && !empty($errors)){?>
    $('html, body').animate({scrollTop: $("#error").offset().top}, 2000);
<?php } ?>
fobos 19 Posting Whiz in Training

in XAMPP, there is a build in mail system called mercury mail. if you want to use smpt, you need to get that info from yahoo, google.. unless your using outlook, then just use that info.

fobos 19 Posting Whiz in Training

You could also try this

<script type="text/javscript">
function signup(){
    var username = document.getElementById("text_username").value;
    var password = document.getElementById("text_password").value;
    alert(username + " " + password);
    return false;
}
</script>


<form action="do_signup" method="post" onsubmit="signup()">
Username : <input type="text" id="text_username" /><br />
Password : <input type="password" id="text_password" /><br />
<input type="submit" name="submit_button" value="Signup" />

</form>

Or if your form and inputs had a name:

<script type="text/javascript">
function greeting(){
    alert("Welcome " + document.forms["frm1"]["fname"].value + "!")
}
</script>
</head>
<body>

What is your name?<br />
<form name="frm1" action="submit.htm" onsubmit="greeting()">
<input type="text" name="fname" />
<input type="submit" value="Submit" />
</form>

Hope this helps

fobos 19 Posting Whiz in Training

You will probably have to use DOM and get the elements id, like in javascript. I had the same problem in javascript, but i figured it out using jQuery and its simple.

Click Here

fobos 19 Posting Whiz in Training

Dude,
if you want to sort by desc, or asc, then just have an html option where the values are <?php self...?sort=asc

then have your php code

if(!isset('something')) {
mysql code ORDER BY ASC
}

check out www.w3schools.com. really good play to begin learning.

fobos 19 Posting Whiz in Training

Mark solved please!

Sahil89 commented: :D ya its really bad thing, newbies should learn it. +2
fobos 19 Posting Whiz in Training

Now, when you log in as Admin, do you "Sucessfuly" log out so the session is destroyed? The only thing i can think of is the session not being destroyed and the member gets the session because its still active. Or when you log in as Member, what is the "Particular Page" that you go to, and does members session work on all other pages? Or do you log in as Member and you click on a nother page after logging in and you get admin role?

Please post your code of what you have for the php so we can look at it. Right now all we can do is just spitwad at the idae

fobos 19 Posting Whiz in Training

Did you try taking out the return in your onClick? onClick="dynaBlock()"

fobos 19 Posting Whiz in Training

You need to make your parent div have a position: relative and #answer 1 & 2 need to have position:absolute; z-index: 100

# .cont a { text-decoration:none; font-family: Calibri, Arial, sans-serif; font-size: 14px; color:#000; position:relative}
#answer1 { border: 1px solid black; color: grey; width: 300px; display:none; margin-left: 115px; margin-top: -15px; padding: 10px; font-size: 12px; font-family: Calibri, Arial, sans-serif; height: 135px; position:absolute; z-index: 150; }
#answer2 { border: 1px solid black; color: grey; width: 300px; display:none; margin-left: 115px; margin-top: -15px; padding: 10px; font-size: 12px; font-family: Calibri, Arial, sans-serif; height: 135px; position:absolute; z-index: 150; }
Albert Pinto commented: Thanx.... +0
fobos 19 Posting Whiz in Training

$search_id = $_POST['searchID'];
$searchById = "SELECT * FROM tc_tool.forms WHERE doc_id LIKE "%$search_id%"';

But i think the problem is with your table name because database and table names cannot contain “/”, “\”, “.”, or characters that are not permitted in file names.
So..

tc_tool**.forms**

is innapropriate, but

tc_tool

is ok to use.

fobos 19 Posting Whiz in Training

Make sure the css' are not conflicting. There has been many times where i have had that happen to me. Did you build the floating menu on your computer?

fobos 19 Posting Whiz in Training

i would suggest running my script as a test page seperately from your website, so you can understand the basics of AJAX, that way you can impliment your code into your php page. Here is a link where you can read on how AJAX works
W3SCHOOLS

fobos 19 Posting Whiz in Training

It would be easier to achieve this using AJAX.

<script type="text/javascript">
function showReg(str) {
    var xmlhttp;    
    if (str=="") {
        document.getElementById("regresult").innerHTML="";
        return;
    }
    if (window.XMLHttpRequest) {
        xmlhttp=new XMLHttpRequest();
    } else {
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4 && xmlhttp.status==200) {
            document.getElementById("regresult").innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET","getregistrationnum.php?q="+str,true);
    xmlhttp.send();
}
</script>

//HTML

<input type="text" name="admission_no" id="textfield" onkeyup="showReg(this.value)" />
<div id="regresult"></div>

//PHP getregistrationnum.php

<?php
$reg = $_GET['q'];
echo $reg;
?>

this is to get you started. just use the if($num_rows >= 1) { do something }

fobos 19 Posting Whiz in Training
fobos 19 Posting Whiz in Training

Maybe something like this. You are using arrays, so you have to define them in your function.

function motor(){
    num = document.getElementyById("input").value;
    var qnt = new Array();
    qnt[0] = num;
    var n = qnt.length;
    var show = new Array();
    for(i=0;i<n;i++){
        show[i] = getElementTagName("label");
        show[i].innerHTML = qnt[i];
    }
}
<a onclick="motor()" id="input">

UNTESTED!!

fobos 19 Posting Whiz in Training

did you try putting a 0 in the label id?

label id="text_cost[0]">0.00</label>
fobos 19 Posting Whiz in Training

maybe something like

function showtip(id) {
    $(id).css "visibility" : "visible";    
}
function hidetip(id) {
    $(id).css "visibility" : "hidden";    
}

then add this to your href:

<a href='#' onmouseover='showtip('".row['id']."')' onmouseout='hidetip('".row['id']."')'>description</a>
<div id='".row['id']."'><?php echo $row['description'];?>   </div>

i think onmouseover='' and onmouseout='' needs to have javascript: in it. like onmouseout='javascript:hidetip()'. i hope this helps

fobos 19 Posting Whiz in Training

Well you go results with your code, until you used mine. Here is yours that worked, just took out the alerts.

<script type="text/javascript">
function showUser(str)	{
var xmlhttp; // You forgot to add this.
var1 = document.getElementById("users").value;
if (var1=="")	{
	document.getElementById("txtHint").innerHTML="";
	return;
}

if (window.XMLHttpRequest)	{
// code for IE7+, Firefox, Chrome, Opera, Safari
	xmlhttp=new XMLHttpRequest();
}

else	{// code for IE6, IE5
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}

xmlhttp.onreadystatechange=function()	{
	if (xmlhttp.readyState==4 && xmlhttp.status==200)	{
		document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
	}
}

xmlhttp.open("GET","getuser.php?q="+str,true);
xmlhttp.send();
}
</script>
fobos 19 Posting Whiz in Training

change var1 to user that way its not being confused as a variable like xmlhttp

var1 = document.getElementById("users").value;
to 
user = document.getElementById("users").value;
and change
if(var1==""){
to
if(user==""){
and change
xmlhttp.open("GET","getuser.php?q="+var1,true);
to
xmlhttp.open("GET","getuser.php?q="+user,true);
fobos 19 Posting Whiz in Training

did you use this one?

//try putting in an alert in the beginning.
<script type="text/javascript">
function showUser() {
    var xmlhttp; // You forgot to add this.
    var1 = document.getElementById("users").value;
    if(var1==""){
        document.getElementById("txtHint").innerHTML = "";
        return false;
    }
    if (window.XMLHttpRequest) {
        // code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    } else {
        // code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4 && xmlhttp.status==200) (
            document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET","getuser.php?q="+var1,true);
    xmlhttp.send();
}
</script>

with this

<select name="users" id="users" onchange="showUser()">
fobos 19 Posting Whiz in Training

Ajax is not an installation.
AJAX is based on internet standards, and uses a combination of:
-XMLHttpRequest object (to exchange data asynchronously with a server)
-JavaScript/DOM (to display/interact with the information)
-CSS (to style the data)
-XML (often used as the format for transferring data)

AJAX applications are browser- and platform-independent!

fobos 19 Posting Whiz in Training

lol thats because you have the 2 alerts in there.

function showUser(str) {
    var xmlhttp; // You forgot to add this.
    // Take out
    var1 = document.getElementById("users").value;
    alert(var1);  
    if (str=="")	{	
        document.getElementById("txtHint").innerHTML="";	
        return;
    } 
// Alert
alert(str);// Take this out also.

Now it should be fine.

fobos 19 Posting Whiz in Training

No problem man. there was an update on my thread with a couple of things. 1) you needed to add the var xmlttp, so i did that in the second to last code block. Also, added the select code block. So does it work now?

fobos 19 Posting Whiz in Training

Ok, well 2 things that you need to try for me. We are going to do some error checking.
On your php page that gets called, instead of

$q  = $_GET['q'];

Try puutting a number in its place and run the page by its self.

$q = "1";

If that works, then we will move on to the javascript. If not, then redo your query statement and re run the statement with the same code from above.

/* Old */
$sql="SELECT * FROM table WHERE id = '".$q."'";
/* New */
$sql="SELECT * FROM table WHERE id = '$q'";

Now the javascript.

//try putting in an alert in the beginning.
<script type="text/javascript">
function showUser(str) {
    if (str=="") {
        document.getElementById("txtHint").innerHTML="";
        return;
    }
    // Alert
    alert(str);
    if (window.XMLHttpRequest) {
        // code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    } else {
        // code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4 && xmlhttp.status==200) (
            document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET","getuser.php?q="+str,true);
    xmlhttp.send();
}
</script>

if the string doesnt get passed, try this.

//try putting in an alert in the beginning.
<script type="text/javascript">
function showUser() {
    var xmlhttp; // You forgot to add this.
    var1 = document.getElementById("users").value;
    alert(var1);
    if(var1==""){
        document.getElementById("txtHint").innerHTML = "";
        return false;
    }
    if (window.XMLHttpRequest) {
        // code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    } else {
        // code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4 && xmlhttp.status==200) (
            document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET","getuser.php?q="+str,true);
    xmlhttp.send();
}
</script>

Make sure you add …

fobos 19 Posting Whiz in Training

lol fabos..

fobos 19 Posting Whiz in Training

mark solved and rep points

fobos 19 Posting Whiz in Training

Awwww no rep points

fobos 19 Posting Whiz in Training

lol thanks for catching that.. my mistake

<form action="" method="post">	
    <fieldset> 		
    <select name="users" onchange="showUser(this.value)">	            
        <option value="">Select a Kinase:</option>
        <!-- RUN QUERY TO POPULATE DROP DOWN -->		
        <?php		
        $query = "SELECT * FROM kbaCalc ORDER by kinase"; 		
        $result = mysql_query($query) or die(mysql_error());		
        /*$num = mysql_num_rows($result);*/ 		
        while($row = mysql_fetch_array($result))	{ 			
            echo "<option value='".$row['id']."'>".$row['kinase']."</option>"; 
        } 
        ?> 	                           
    </select>                 
    <div id="txtHint">Stuff here!</div>          
    </fieldset>
</form>

I knew something was up..lol. Now, this will populate the option.

fobos 19 Posting Whiz in Training

From what i have learned in the past, #includes are like prebuilt function that you can use in your source code if you want to reference it. If you dont need it, then just take it out. Im just going off what you said:

My question is: why do we need to include ctime in this code and what is it good for?

I am sorry if there is a problem with your coding, because i will not be able to answer it. If there is a problem with your code, post what the problem is and what you are trying to achieve.

fobos 19 Posting Whiz in Training

change ID to id and see if that helps