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

Lets see

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

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.

fobos 19 Posting Whiz in Training

@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.

fobos 19 Posting Whiz in Training

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.

fobos 19 Posting Whiz in Training

^^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.

fobos 19 Posting Whiz in Training

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"];
?>
fobos 19 Posting Whiz in Training

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.

fobos 19 Posting Whiz in Training

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.

fobos 19 Posting Whiz in Training

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?

fobos 19 Posting Whiz in Training

Try
close your first echo with a quote and semi colon

fobos 19 Posting Whiz in Training

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

fobos 19 Posting Whiz in Training

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

fobos 19 Posting Whiz in Training

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

fobos 19 Posting Whiz in Training

Here you go

w3schools.com

fobos 19 Posting Whiz in Training

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

fobos 19 Posting Whiz in Training
  • 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.

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

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

fobos 19 Posting Whiz in Training

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.

fobos 19 Posting Whiz in Training

Have you tried removing the semicolon?

$sw11 = "hi";
$symp39=$sw11;
echo $symp39;
fobos 19 Posting Whiz in Training

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

$sw11 = "hi";
$symp39=$sw11.";";
echo $symp39;
fobos 19 Posting Whiz in Training

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

fobos 19 Posting Whiz in Training

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

fobos 19 Posting Whiz in Training

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

yup, it searches for which one it is.

if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
    loadcssfile(ipad.css, css);
}
fobos 19 Posting Whiz in Training

you could try this to detect the browser.

if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
 // some code..
}
fobos 19 Posting Whiz in Training

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.

fobos 19 Posting Whiz in Training

Can you please post your php code, because this is a problem with your mysql statement. Thanks

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

That because something is using port 80. in the control panel, there is a button called port check. It will tell you what program is using that port.

fobos 19 Posting Whiz in Training

This is a really good website that i learned from.

W3Schools

fobos 19 Posting Whiz in Training

Whats the code for the _partialview page? That will be better to look at than a 2 line code that no one can help you with.

fobos 19 Posting Whiz in Training

You can try:

if(!mysql_num_rows($result) || mysql_num_rows($result) == 0) 
{  
    echo "<b>Not Found</b>";  
}

or

 (mysql_num_rows($result) < 1)

If that still doesnt work, then the problem is before that, with your select statement.

fobos 19 Posting Whiz in Training

Or just pull the data using ajax

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

This post is dead, dont bring it back. Besides, dont hijack peoples post.

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

Here is a website that tells you alot of useful things Click Here. But when in doubt, go to the apache website
Click Here.

fobos 19 Posting Whiz in Training

You might have to re-install your OS. What were you "working on" when this happened?
Heres a link if you get your keyboard working. Click Here

fobos 19 Posting Whiz in Training

Do you have 4 ram slots (Channel A and B)? I think you have 4 slots.
You have can up to 4GB total, but will only be able to utilize the 3GB rule. You must have either 2 or 4 ram sticks installed, but not have 2 in channel A and one in channel B or vice verse. What is your motherboard name and model?

fobos 19 Posting Whiz in Training

Other thoughts:
- re-install W7 and perform updates (without installing drivers). W7 usually provides drivers in update.
- Do you have the right RAM installed? if you didnt change then no worries.
- Did you have any problems with W7U on your old hard drive?

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

AleMonteiro, this post is dead, please dont bring it back from the grave.

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?