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;
}

Lets see

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.

Hello all,
i have a small question, i data dumped my torrent file and i forgot how to convert the date string to an actual date.

Example.
["creation date"]=> float(1392057306)

I havent worked with php in a while and im finally getting back into my project. Thanks for any support.

@SimonIoa, the onfocus event will remove the "Search".
With that being said, SimonIoa still has a point. You should have that in your input if you are asking to verify if its blank or not. Instead of calling a $_REQUEST, use $_POST instead. $_REQUEST is the default if you didnt have anything else, but this is no perfect world. Also if your checking to see if its blank why run another elseif. I mean that you are already checking to see if its blank so there is no reason to see if there is something there, unless you are unescaping the string.

I would try to give it a test..

<?php
if(isset($_POST["search_all"])) {
    if($_POST["search_all"]==" " || $_POST["search_all"] == "Search") {
        return false;
    } else {
        return true;
    }
}
?>

I hope this helps.

Wait, so was i in the wrong? i noticed aimthwee got two down votes. I do agree with you, but what he said is something that i wasnt expecting. I like this site and i have helped out many of people, but never am im i blunt like that. I was just mearly asking how to return a fetch array in a function.

I know your way works diafol, but just trying to, again return it in a function. Thanks again guys for your support.

^^That right there tells me you don't even know how to use functions. Go back to basics bro.

If i wanted a dickhead answer, i would have asked for it.

Thanks diafol. Im still learning how that works.

Man this is rough, how do i return rows in a function using mysqli. Heres what i have:

db_connect.php

<?php
function dbconn($autoclean = false) {
    $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE);
    $result = $mysqli->query("SELECT * FROM users WHERE id = '2'");
    $rows = $result->fetch_array(MYSQLI_ASSOC);
    if(!$rows) {
        return;
    }
    if ($autoclean) {
        register_shutdown_function("autoclean");
    }
}
?>

index.php

<?php
dbconn();
echo $rows["username"];
?>

This is the code i use. I will just revert to mysqli to see what i get. Thanks for the help right now. If i have anything else, ill repost it.

Thanks again guys.

No issue with global connections. if i put the mysql_query and assoc in index.php and run it that way, everything works. but since if have it in the function, it just wont return.

if i put an echo after the if statement for the connection, it echos. Also, i include above the function, an include which has the defines for username password and db.

Hello all,
im having some problem, i have a function call dbconn which i run after my session. i can successfully connect to the database and run the mysql statement outside of the function with no problems. However, when i put it in the function and return it, nothing happens. Example:

index.php

<?php
include_once 'includes/db_connect.php';

sec_session_start();
dbconn();
echo $rows["username"];
?>

db_connect.php

<?php
function dbconn($autoclean = false) {
    if (!@mysql_connect(HOST, USER, PASSWORD)) {
        switch (mysql_errno()) {
            case 1040:
            case 2002:
            if ($_SERVER['REQUEST_METHOD'] == "GET") 
                die("<html><head><meta http-equiv='refresh' content=\"5 $_SERVER[REQUEST_URI]\"></head><body><table border='0' width='100%' height='100%'><tr><td><h3 align='center'>The server load is very high at the moment. Retrying, please wait...</h3></td></tr></table></body></html>");
            else
                die("Too many users. Please press the Refresh button in your browser to retry.");
        default:
            die("[" . mysql_errno() . "] dbconn: mysql_connect: " . mysql_error());
        }
    }
    mysql_select_db("sh") or die(mysql_error());
    mysql_set_charset('utf8');
    $res = mysql_query("SELECT * FROM users WHERE id = ".htmlentities($_SESSION["id"])." AND enabled='yes' AND status = 'confirmed'");// or die(mysql_error());
    $rows = mysql_fetch_assoc($res);
    if (!$rows)
        return $rows;

    if ($autoclean)
        register_shutdown_function("autoclean");
}
?>

if i echo a statement after return $rows, it echos. What am i doing wrong?

Try
close your first echo with a quote and semi colon

Have you tried calling the function with onblur then get the value to pass?

<input type="text" name="txtSearchPolicyNumber" id="txtSearchPolicyNumber" onblur="showResults();" />

When you perform the "onBlur", it will call the function, get the value and check to see if its blank.

function showResults() {
    var policynumber = document.getElementById("txtSearchPolicyNumber").value;
    if ( policynumber == "" ){
        //test
        alert("no number");
        document.getElementById("txtHint").innerHTML = "";
        return;                                
    }
// and the rest of the code..
}

Also, in your php, just try running the sql statement without the table headers and just echo a single row. Just for testing purposes

require_once '../../moonlight/includes/mysql_connect.php';
$policyNumber = $_GET['pnumber']; 
// assign the $_GET['pnumber'] to $policyNumber

$sql = "SELECT * FROM paymentshistory WHERE policyNumber = '$policyNumber' ORDER BY dateCaptured DESC";
$result = mysql_query( $sql ) or die( mysql_error() . "<br />$sql" );
while( $row = mysql_fetch_array( $result ) ) {
    echo $row["policyNumber"];
}

what i would also try doing is type in the url code with a policy number to see if there are any errors on the php page.
somewebsite.com/getpaymenthistory.php?pnumber=12345

To display your form in an iframe, you must first put the form onto a page and save it.. let call it form.html. Then you must link that page to the iframe.

<iframe id="something" border="0" width="500px" height="500px" src="form.html"></iframe>

Hope this helps

LastMitch, this thread is old. Please dont raise the dead

Here you go

w3schools.com

dang you enno, i didnt see the date. Please dont post on dead threads.

  • ok, extract xampp (the .zip version) to a drive or directory (D: or C:) and it will create a folder.
  • Go into the folder and click on control(beta).exe and after that pops up, install the services for http and mysql and start the services. Installing the services will auto start your webserver everytime you start your computer.
  • after that, go to your browswer and type in "localhost", the xampp splash page will pop up and select english.
  • Congrats you have a running webserver.
  • If the webserver fails to start, use the "check ports" on the left to see whats using 80/443 and the same for mysql 3304. Hope this helps.

All files will go into htdocs.

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.

Have you tried putting
session_start()
at the top of the page?

you should have said that in the beginning

what I want is
---- > 1;3;5;7

So you will probably have to do something like this

if(isset($sw11)) {
$symp39=$sw11;
}  else {
 $symp39=NULL;
}

if(isset($sap_rel)) {
    if($symp39 = NULL) {
        $symp40 = $sap_rel;
    } else {
        $symp40 = symp39.”;”.$sap_rel;
    }
} else {
    $symp40=NULL;
}

Or just make the first isset "$sw11" a required field and put the semicolons on the rest of the variable in front, so this way the first will always show with no semicolon, and the rest -- weather NULL or not -- will have a semi colon in front of it.

---> 1
---> 1;3
---> 1;5
---> 1;3;5

and so forth.

Have you tried removing the semicolon?

$sw11 = "hi";
$symp39=$sw11;
echo $symp39;

When i run this statement, it works fine for me. What does the error say?

$sw11 = "hi";
$symp39=$sw11.";";
echo $symp39;

try this website, it will help you to use mime content type. Hope that helps

in your select input, have an onchange function that will call a function that will reload the page (or direct to another) with the value in the url.

<select name="cars" onchange="myfunction()">

then call for the redirect function.

function myfunction(){
  var sel = document.getElementById("cars").value;
  window.location = "yourpage.php?id="+sel;
}

Then use the $_GET to get the value from the url. This is just to get the ball rolling. Hope it helps

Try just comparing the two variables of the dates.

var strtdate = document.getElementById("x_START_DATE").value; 
var enddate = document.getElementById("x_END_DATE").value;
if(strtdate >= enddate) {
    window.scrollTo(0,0);
    alert("End date should not be less than start date.");
    return false;
} else {
    alert("Good");
}

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?

yup, it searches for which one it is.

if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
    loadcssfile(ipad.css, css);
}

you could try this to detect the browser.

if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
 // some code..
}

From what i see, you have the connection, but you need to include the variable into the mysql_select_db

$objDB = mysql_select_db("mydatabase", $objConnect);

Second, make sure to difine txtKeyword. just add $txtKeyword = $_GET['textKeyword']. I would just make one if statement.

if (!isset($_GET['txtKeyword'])) {
    if($_GET["txtKeyword"] != "") {
        $txtKeyword = "%"
    }
    // rest of connection

Also, make sure you know the difference from $_GET and $_POST. To really test it, just have the connection by its self just to make sure everything is ok. I hope this helped.