Jump to content

khhalid

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Everything posted by khhalid

  1. Sorry MrAdam, I'm using HTML, JScript & PHP together. I will try your solution, thanks;
  2. I am using HTML with JavaScript (JS). Any JS example will be very helpful, please.
  3. hi Guys, I have html <input type = 'text'...> field where user can enter date. Is there a way to make sure a valid date has been entered and the format is 'dd'/mm/yyyy'. Many thanks
  4. thanks for your reply, sorry, it was typing mistake when I was trying different codes. But even I have change the variable back to $resultSet, it is empty in login.php. Have had a chance to pass resultSet between PHP pages? Many thanks for your time, K
  5. Hi guys, I am using PHP 5.25 with SQL Server. I have install 'SQL server driver for PHP'. I am building login page with SQL Server DB authentication. So, my login.php pass SQL query to a function named 'querySQLServer' in functions.php. I can see the resultset within functions.php but when return to login.php, resultset is empty. <?php //login.php include_once 'functions.php'; echo "<h3>Bookmaker Log in</h3>"; $error = $user = $pass = ""; if (isset($_POST['user'])) { $user = $_POST['user']; $pass = $_POST['pass']; $query = "exec fodSelectLogin '$user' , '$pass'"; $result = querySqlServer($query); //** this $result is empty and fail the authentication** if (sqlsrv_has_rows($result) === false ) { $error = "Username/Password invalid<br />"; } else { $_SESSION['user'] = $user; $_SESSION['pass'] = $pass; die("You are now logged in. Please <a href='members.php?view=$user'>click here</a>."); } } echo <<<_END <form method='post' action='login.php'>$error Username <input type='text' maxlength='16' name='user' value='$user' /><br /> Password <input type='password' maxlength='16' name='pass' value='$pass' /><br /> <input type='submit' value='Login' /> </form> _END; ?> <?php //functions.php define("DB_SERVER", "NDRDT034\SQLEXPRESS"); define("DB_USER", "northdoor"); define("DB_PASS", "N0rthd00r"); define("DB_NAME", "LevyDataDevelopment"); $appname = "HBLB - FOD"; function querySqlServer($query) { //connection details $connectionInfo = array("Database" => DB_NAME , "UID" => DB_USER, "PWD" => DB_PASS); //connecting $dbconn = sqlsrv_connect(DB_SERVER, $connectionInfo) or die("Couldn't connect to SQL Server on DB_SERVER"); $resultSet = sqlsrv_query($dbconn, $query); if( $result === false ) { echo "Error in executing query.</br>"; die( print_r( sqlsrv_errors(), true)); } return $resultSet; } ?>
  6. Hi guys, Can someone please help me to create simple table with some text in pdf file using PHP? thanks for your time, K
  7. hi guys, I'm need to create Declaration form in PDF format. I manage to create the PDF function which create the PDF file and set front etc. Now I need the following: Task1 Create three tables in newly created PDF; Task2 Add some text in those tables; Task3 select option box at the top which allow user to display one table and remove other tables Here are the codes for creating PDF: <?php Function CreatePDF($Path) { //Resource create for PDF library $pdf = PDF_new(); pdf_open_file($pdf, $Path); //Page diemention (A4) pdf_begin_page($pdf, 595, 842); //path of your TTF font directory $fontdir = "C:\WINDOWS\Fonts"; pdf_set_parameter($pdf, "FontOutline", "arialMyName=$fontdir\arial.ttf"); $arial = PDF_findfont($pdf,"arialMyName","host",0 ); //Set font size and font name pdf_setfont($pdf, $arial, 10); //print text pdf_show_xy($pdf, "HBLB PDF",50, 750); pdf_show_xy($pdf, "New PDF created.", 50,730); pdf_end_page($pdf); pdf_close($pdf); $status = "PDF created in: " . $Path; return $status; } echo CreatePDF("C:\Projects\HBLB\FOD\htdocs\kh\php\HBLB.pdf"); ?> Many thanks for your help,
  8. you were right, it was my application need permission to access into the location. Thanks for help,
  9. thanks Adam, what do you mean by script permissions? i have checked the folder permissions (where my script reading file and writing file) and the locations are exist.
  10. Hi guys, I want to move Excel file from one folder into another one. I am using following codes: <?php $file = "/uploaded/DMZ/newTest.txt"; $newlocation= "/uploaded/scanned/newTest.txt"; rename($file, $newlocation); ?> Nothing happening when I execute the code. Many thanks K
  11. sorry no joy, this is displaying my messages but nothing else [attachment deleted by admin]
  12. csscan.exe is thecommand line application. I have ran in cmd and the summary section is what I am after (see attachment). Here are the codes I am using: <?php echo "start scanning..."; $return = array(); $tmp = exec("C:\Program Files\McAfee\VirusScan Enterprise\csscan.exe /c C:\48SchemeTemplate.xls", $return); foreach( $return as $line ) { echo $line,"\n\n"; } echo "scanning done."; ?> [attachment deleted by admin]
  13. Hi Guys, I am trying to do an anti virus scan on the files I am uploading in PHP application and return virus found or not. if found then delete the file else load scanned file into "Scanned" folder. I am trying exec() function but not sure how to pass data file path to exec() function. I am using: <?php $tmp = exec("C:\Program Files\McAfee\VirusScan Enterprise\scan32.exe C:\48 SchemeTemplate.xls", $results); echo "Result: " . $results; ?> Can someone please help me. Many thanks for your time, ND
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.