Dev Shed Forums - PHP Development http://forums.devshed.com/ PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm. en Mon, 16 Jul 2018 17:41:40 GMT vBulletin 60 http://forums.devshed.com/images/misc/rss.png Dev Shed Forums - PHP Development http://forums.devshed.com/ Open_BaseDir function in plesk windows server not working. http://forums.devshed.com/php-development/980857-open_basedir-function-plesk-windows-server-new-post.html Sun, 15 Jul 2018 05:20:29 GMT hi, i am trying to access files outside of domain root dir. i know php can handle that. please check following image: Attachment 14121 (http://forums.devshed.com/attachment.php?attachmentid=14121) i update/set in plesk to add the additional directory. hi, i am trying to access files outside of domain root dir.

i know php can handle that.

please check following image:

Plesk.png

i update/set in plesk to add the additional directory.

then i also check the .user.ini file, that folder is also there:
Code:

open_basedir="C:/Inetpub/vhosts/myDomain.com\;C:\Windows\Temp\;C:\DLoads\"
but still when i try to run my php file/script it throws following error:

Code:

PHP Warning:  filesize(): open_basedir restriction in effect. File(c:\DLoads\Test.txt) is not within the allowed path(s): (C:/Inetpub/vhosts/myDomain.com\;C:\Windows\Temp\;C:\DLoads\) in C:\Inetpub\vhosts\myDomain.com\httpdocs\t5.php on line 3
below is my sample php script:
Code:

$file = 'c:\DLoads\Test.txt';
echo filesize($file);

so, what did i miss? what else setting i need to change to accept that?

is any ISS config missing?

thanks in advance
Attached Images
]]>
PHP Development zakir_szh http://forums.devshed.com/php-development-5/open_basedir-function-plesk-windows-server-980857.html
Digital Signatures http://forums.devshed.com/php-development/980856-digital-signatures-new-post.html Sat, 14 Jul 2018 11:45:20 GMT Hi: I have a business management system which is written in PHP/MySQL and includes various functions such as CRM, Business Development, Sales Management. etc. My customers (SAAS) use it to manage their businesses and THEIR customers can login to access important documents, purchase products and services, etc. I would like to add electronic signatures as a feature so my customers can have... Hi:

I have a business management system which is written in PHP/MySQL and includes various functions such as CRM, Business Development, Sales Management. etc. My customers (SAAS) use it to manage their businesses and THEIR customers can login to access important documents, purchase products and services, etc.

I would like to add electronic signatures as a feature so my customers can have their customers digitally sign agreements. Currently, there is a simple "Type your name here and check the box indicating you agree to the terms of this [document] ". Technically, that is not a digital signature and I am sure it could be challenged in court. For more robust purposes, the system has the ability to download, scan and upload actual paper signatures.

What's the best way to include a verifiable digital signature. I'd like not to go down the road of Docusign (or similar) because I think it will get pretty pricy, given the number of users.

Does anyone have any experience developing simple electronic signatures? Is it something I can program myself and have it legally binding?

Thanks ]]>
PHP Development SeanF http://forums.devshed.com/php-development-5/digital-signatures-980856.html
Invalid parameter number: mixed named and positional parameters http://forums.devshed.com/php-development/980851-invalid-parameter-mixed-named-positional-parameters-new-post.html Fri, 13 Jul 2018 00:15:43 GMT I have a requirement where for a user I need to find if they have one or more variables which are pulled from one column,
I am getting "Invalid parameter number: mixed named and positional parameters" error. I start by placing all the variables into an array, which will then be
used as an IN, I then have the userid variable to check against also. The error is throwing on the last line, what is the appropriate way of mixing this in and = to get the results?

PHP Code:

    $arr = [$ability2$ability3$ability4$ability5$ability6$ability7$ability8$ability9$ability10];
$in  str_repeat('?,'count($arr) - 1) . '?';
$validation_abilities_scan $DB_con2->prepare("SELECT userid, ability_id from validation_abilities where ability_id IN ($in) AND userid = :userid_confirmed");
$validation_abilities_scan->execute(); 

Thanks,

G ]]>
PHP Development genista http://forums.devshed.com/php-development-5/invalid-parameter-mixed-named-positional-parameters-980851.html
PHPiPhone Barcode Scanner http://forums.devshed.com/php-development/980800-phpiphone-barcode-scanner-new-post.html Tue, 26 Jun 2018 17:14:13 GMT Hi:

I am working on a very simple inventory program built in PHP/MySQL which uses a barcode scanner to identify products and then counts, adds, or subtracts quantities input by the user.

I am using as a starting point, an ap called "Pic2Shop Pro" and the companion PHP code by Zone1 Creative (Pic2shop PRO | HTML5 Barcode Scanner App for iPhone iPad and Android)

Basically, the iPhone ap is configured with a callback URL which is the processing page for the scan. The page has a button on it to initiate the scan which submits a $_GET variable called "$_GET['barcode']" The code for the button looks like this:
PHP Code:

<div class="scan-section" style="text-align:center">
<a href="p2spro://scan?formats=EAN13,EAN8,UPCE,ITF,CODE39,CODE128,CODE93,STD2OF5,CODABAR,QR&callback=<?php echo urlencode($callback_url); ?>" class="btn btn-primary btn-lg">Start Scan</a>
</div>

I have been able to configure this so I can scan a barcode, read the $_GET variable, enter a quantity in an "input" field and submit both the barcode and the quantity to a MySQL INSERT command. Works perfectly for simply entering a quantity (counting)

Now, I would like to be able to:
  • Scan a Product Bar Code
  • Scan a Customer Bar Code (to charge a product to a customer)
  • Enter a quantity

The problem I have (I think) is that the scan function has only one callback url so for multiple buttons, so to differentiate one scan from another, I need to embed another $_GET variable into the button so that different data fields are assigned depending on what button is pressed.

I tried altering the link as follows:
Code:

=<div class="scan-section" style="text-align:center">
=<a href="p2spro://scan?formats=EAN13,EAN8,UPCE,ITF,CODE39,CODE128,CODE93,STD2OF5,CODABAR,QR&scn=product&callback=<?php echo urlencode($callback_url); ?>" class="btn btn-primary btn-lg">Start Scan</a>
=</div>

But the "scn" variable is not being read, presumably because it is going to "p2spro://scan" which doesn't know what to do with it

How can I differentiate one scan from another to execute different parts of a logic tree? Am I even on the right track?

All comments are welcome ]]>
PHP Development SeanF http://forums.devshed.com/php-development-5/phpiphone-barcode-scanner-980800.html
Pass PDO Connection Between Functions Like A Basketball http://forums.devshed.com/php-development/980784-pass-pdo-connection-functions-basketball-new-post.html Thu, 21 Jun 2018 06:14:38 GMT Hi; How can I do this without having to use classes (and singleton, DI etc)? Possible to do it only with functions (fully procedural )or even session? PHP: --------- function connect_to_db() Hi;

How can I do this without having to use classes (and singleton, DI etc)?

Possible to do it only with functions (fully procedural )or even session?

PHP Code:

function connect_to_db()
    {
        
$conn = new PDO("mysql:host=".SEREVERNAME.";dbname=".DATABASE.""DB_USERNAMEDB_PASSWORD);
        
$conn $conn->setAttribute(PDO::ATTR_ERRMODEPDO::ERRMODE_EXCEPTION);
        
$_SESSION['connection'] = $conn;
    }
function 
one()
    {
        
$stmt $_SESSION['connection']->prepare("SQL");
        
$stmt->bindParam(':things'$things);
        
$stmt->execute();
    }
function 
two()
    {
        
$stmt $_SESSION['connection']->prepare("SQL 2");
        
$stmt->bindParam(':things'$things);
        
$stmt->execute();
    } 

PHP Code:

function connect_to_db()
    {
        if(!
existing_connection)
            {
                
$conn = new PDO("mysql:host=".SEREVERNAME.";dbname=".DATABASE.""DB_USERNAMEDB_PASSWORD);
            }   
        else 
            {
                
$conn existing_conneciton;
            }     
        return 
$conn->setAttribute(PDO::ATTR_ERRMODEPDO::ERRMODE_EXCEPTION);
    }
function 
one()
    {
        
$stmt connect_to_db()->prepare("SQL");
        
$stmt->bindParam(':things'$things);
        
$stmt->execute();
    }
function 
two()
    {
        
$stmt connect_to_db()->prepare("SQL 2");
        
$stmt->bindParam(':things'$things);
        
$stmt->execute();
    } 

]]>
PHP Development English Breakfast Tea http://forums.devshed.com/php-development-5/pass-pdo-connection-functions-basketball-980784.html