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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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