Jump to content

need small help


Deoctor

Recommended Posts

Hai 

i have a code which runs in the browser, but i need to run it in the command prompt like this

php <filename.php> <input>

 

where filename.php is the file which i need to run and the <input> is the one where i need to give the one which i need to run..

dont know how to do this..

can any one help me..

sorry for BAD english..

 

 

Link to comment
https://forums.phpfreaks.com/topic/203505-need-small-help/
Share on other sites

filename.php is the code which i am going to run and the <input> is the one which i need to give..

<?php
function libxml_display_error($error) 
{ 
    $return = "<br/>\n"; 
    switch ($error->level) { 
        case LIBXML_ERR_WARNING: 
            $return .= "<b>Warning $error->code</b>: "; 
            break; 
        case LIBXML_ERR_ERROR: 
            $return .= "<b>Error $error->code</b>: "; 
            break; 
        case LIBXML_ERR_FATAL: 
            $return .= "<b>Fatal Error $error->code</b>: "; 
            break; 
    } 
    $return .= trim($error->message); 
    if ($error->file) { 
        $return .=    " in <b>$error->file</b>"; 
    } 
    $return .= " on line <b>$error->line</b>\n"; 

    return $return; 
} 

function libxml_display_errors() { 
    $errors = libxml_get_errors(); 
    foreach ($errors as $error) { 
        print libxml_display_error($error); 
    } 
    libxml_clear_errors(); 
} 

// Enable user error handling 
libxml_use_internal_errors(true); 

$xml = new DOMDocument(); 
$xml->load('word.xml'); 

if (!$xml->schemaValidate('alto-1-4.xsd')) { 
    print '<b>DOMDocument::schemaValidate() Generated Errors!</b>'; 
    libxml_display_errors(); 
} 
else {  
echo "validated"; 
} 
?>

 

this is the code which i am using in this word.xml is the name of the input that i need to give while running at the command prompt as the input filename keeps on changing..

 

Link to comment
https://forums.phpfreaks.com/topic/203505-need-small-help/#findComment-1066076
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.