-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
run this and tell me how many rows you have and the also post the A's and B's echo'd its kinda hard you workout the problem without knowing the database $queryAA="SELECT staff_no from report "; $resultAA = mysql_query($queryAA,$dblink); while($rowAA = mysql_fetch_row($resultAA)) { echo "A"; $query="SELECT user.acc_no, report.staff_no, user.name, report.amount FROM user LEFT JOIN report on report.staff_no= user.staff_no WHERE status ='approve'and user.bank='maybank'and user.staff_no= '$rowAA[0]'" ; // echo $query; $result = mysql_query($query,$dblink); while($row = mysql_fetch_row($result)) { echo "B"; // $x_pos = $pdf->SetX(50); $y_pos = $pdf->GetY(); $pdf->SetX(40); $pdf->Cell(50,6,$row[0],1,0,'C',1); $pdf->SetX(90); $pdf->Cell(40,6,$row[1],1,0,'C',0); $pdf->SetX(130); $pdf->Cell(80,6,$row[2],1,0,'C',0); $pdf->SetX(210); $pdf->Cell(20,6,$row[3],1,1,'C',0); }[code] [/code]
-
change to $query=mysql_query("insert into members(company, userid, password, email, fname, lname, address, city, state, zip, phone) values('$company','$userid','$password','$email','$fname', '$lname','$address', '$city', '$state', '$zipcode', '$phone')"); changed '$phone', to '$phone'
-
$query="SELECT user.acc_no, report.staff_no, user.name, report.amount FROM user LEFT JOIN report on report.staff_no= user.staff_no WHERE status ='approve'"; add the "; to the end
-
Well as your using POST.. i guess you have a form.. so the link will need to submit that form.. so are you asking for a hyper link instead of a button ? normally your do it like this (for a button) //Form <form method="post"> <input name="firstname" type="text" /><br> <input name="lastname" type="text" /><br> <input name="age" type="text" /><br> <input name="submit" type="submit" value="submit" /> </form> //code <?php if(isset($_POST['submit'])) { //connect to database mysql_select_db("my_db", $con); $sql="INSERT INTO person (FirstName, LastName, Age) VALUES ('{$_POST['firstname']}','{$_POST['lastname']}','{$_POST['age']}')"; } ?>
-
I spotted it (i think) try $query="SELECT user.acc_no, report.staff_no, user.name, report.amount FROM user LEFT JOIN report on report.staff_no= user.staff_no WHERE status ='approve'
-
you changed to $_POST['$password'], which is wrong.. BUT instead i used extract <?php include "include/z_db.php";// database connection details stored here ?> <!doctype html public "-//w3c//dtd html 3.2//en"> <html> <head> <title>Fast Fix Pro Signup</title> </head> <body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000"> <?php extract($_POST); //<---I don't recommand this really if(isset($todo) and $todo=="post") { $status = "OK"; $msg=""; // if userid is less than 3 char then status is not ok if(!isset($userid) or strlen($userid) <3) { $msg=$msg."User id should be =3 or more than 3 char length<BR>"; $status= "NOTOK"; } if(mysql_num_rows(mysql_query("SELECT userid FROM plus_signup WHERE userid = '$userid'"))) { $msg=$msg."Userid already exists. Please try another one<BR>"; $status= "NOTOK"; } if ( strlen($password) < 3 ) { $msg=$msg."Password must be more than 3 char legth<BR>"; $status= "NOTOK"; } if ( $password <> $password2 ) { $msg=$msg."Both passwords are not matching<BR>"; $status= "NOTOK"; } if ($agree<>"yes") { $msg=$msg."You must agree to terms and conditions<BR>"; $status= "NOTOK"; } if($status<>"OK") { echo "<font face='Verdana' size='2' color=red>$msg</font><br><input type='button' value='Retry' onClick='history.go(-1)'>"; }else{ // if all validations are passed. $query=mysql_query("insert into members(company, userid, password, email, fname, lname, address, city, state, zip, phone) values('$company','$userid','$password','$email','$fname', '$lname','$address', '$city', '$state', '$zipcode', '$phone',)"); echo "<font face='Verdana' size='2' color=green>Welcome, You have successfully signed up<br><br><a href=login.php>Click here to login</a><br></font>"; } } ?> </body> </html>
-
can you post what you tried (in the way of the force download)
-
[SOLVED] Custom functions, cant see whats wrong!
MadTechie replied to ukweb's topic in PHP Coding Help
insertsql($database_click_sql, $click_sql, "images", "site_id, page_id, ident, name, loc, description, width, height", "'$row_login['site_id']', '$_POST['page_id']', '$_POST['ident']', '$_POST['name']', '$saveloc.$filemame', '$_POST['description']', '$a_width', '$a_height'"); should be insertsql($database_click_sql, $click_sql, "images", "site_id, page_id, ident, name, loc, description, width, height", "{$row_login['site_id']}', '{$_POST['page_id']}', '{$_POST['ident']}', '{$_POST['name']}', '$saveloc.$filemame', '{$_POST['description']}', '$a_width', '$a_height'"); also change if (mysql_query($insertSQL, $dbuser)) { if (!($no_response == "true")) { to if (mysql_query($insertSQL, $dbuser) or die(mysql_error())) { if (!($no_response == "true")) { -
see ForceDownload
-
change $userid to $_POST['userid'] $password to $_POST['password'] $password2 to $_POST['password2']
-
its probably the SQL statement.. try $query="SELECT user.acc_no, report.staff_no, user.name, report.amount LEFT JOIN report on report.staff_no= user.staff_no FROM user WHERE status ='approve'
-
Why ? preg_replace would work! you maybe better off using sockets instead of curl!
-
change if(isset($todo) and $todo=="post"){ to if(isset($_POST['todo']) and $_POST['todo']=="post"){ also your form is missing quotes it should be like this <form name="form1" method="post" action="signupck.php" <input type="hidden" name="todo" etc etc
-
Yes.. ie <a href="?do=this">do this</a><br><a href="?do=that">do that</a> <?php if(isset($_GET['do'])) { switch($_GET['do']) { case "this": echo "done this"; break; case "that": echo "done that"; break; } } ?> of course this and that will be the input.. to the database (the example is just the concept)
-
will always be the host computer.. i'm not sure what the port referance will be (not something i have really used)
-
On *nix try stty http://unixhelp.ed.ac.uk/CGI/man-cgi?stty Heres a class that uses it. [attachment deleted by admin]
-
PHP serial extension AKA php_ser.dll is not supported on Linux.. your need to find another solution
-
agree with Daukan, advice.. turn register globals off!
-
personally, i do this <?php session_start(); $_SESSION['name'] = 'bob'; $_SESSION['time'] = time(); ?> read comments <?php // Use of session_register() is deprecated $barney = "A big purple dinosaur."; session_register("barney"); // Use of $_SESSION is preferred, as of PHP 4.1.0 $_SESSION["zim"] = "An invader from another planet."; // The old way was to use $HTTP_SESSION_VARS $HTTP_SESSION_VARS["spongebob"] = "He's got square pants."; ?>
-
No no thats to do with register_globals NOT sessions as a whole basically when you try to use $_SESSION['test'] before setting it, it would of pulled from the register_globals, but as from PHP versions 4.3+ it displays a security warning.. that option turns off that warning
-
Nope sessions are note being removed.. it would be a dumb move i assume his confused with something else ie remove register globals (thank god) remove all magic_* and throw E_CORE_ERROR when set(thank god)
-
i think your do something like this on *nix $temp = preg_split("/\s+/",exec("/sbin/ifconfig -a eth1 | /bin/grep HWaddr"), -1, PREG_SPLIT_NO_EMPTY); $sku_machine['MAC_addr_eth1'] = $temp[4]; Keep in mind that MAC Address are no longer unique (they used to be) but they are now being re-used, also you can spoof a MAC address along with IP's etc
-
Yes for security BUT cookies live longer (if set to do so).. sessions expire when you exit the site best bet is to read up see more info here http://www.php.net/manual/en/features.cookies.php http://www.php.net/manual/en/ref.session.php