This has fixed part of the problem as I now get an option to send the zip file to the desktop. Still unable to compress the file to the root directory. This has also fixed a DDE launch issue that I have had since upgrading to windows 10 (DDE launch XML file with XSL reference in iExplore. Have not worked out how to do this with MS Edge).

Name

zipinfo - list detailed information about a ZIP archive

Synopsis

zipinfo [-12smlvhMtTz] file[.zip] [file(s) ..] [-xxfile(s) ..]

unzip -Z [-12smlvhMtTz] file[.zip] [file(s) ..] [-xxfile(s) ..]

Description

zipinfo lists technical information about files in a ZIP archive, most commonly found on MS-DOS systems. Such information includes file accesspermissions, encryption status, type of compression, version and operating system or file system of compressing program, and the like. The default behavior(with no options) is to list single-line entries for each file in the archive, with header and trailer lines providing summary information for the entirearchive. The format is a cross between Unix 'ls -l' and 'unzip -v' output. See DETAILED DESCRIPTION below. Note thatzipinfo is the same program as unzip (under Unix, a link to it); on some systems, however, zipinfo support may have been omitted whenunzip was compiled.

Arguments

file[.zip]

Path of the ZIP archive(s). If the file specification is a wildcard, each matching file is processed in an order determined by the operating system (or filesystem). Only the filename can be a wildcard; the path itself cannot. Wildcard expressions are similar to Unix egrep(1) (regular) expressions and maycontain:
*

matches a sequence of 0 or more characters

?

matches exactly 1 character

[..]

matches any single character found inside the brackets; ranges are specified by a beginning character, a hyphen, and an ending character. If an exclamationpoint or a caret ('!' or '^') follows the left bracket, then the range of characters within the brackets is complemented (that is, anything except thecharacters inside the brackets is considered a match). To specify a verbatim left bracket, the three-character sequence '[[]' has to be used.

(Be sure to quote any character that might otherwise be interpreted or modified by the operating system, particularly under Unix and VMS.) If no matches arefound, the specification is assumed to be a literal filename; and if that also fails, the suffix .zip is appended. Note that self-extracting ZIP filesare supported, as with any other ZIP archive; just specify the .exe suffix (if any) explicitly.
[file(s)]
An optional list of archive members to be processed, separated by spaces. (VMS versions compiled with VMSCLI defined must delimit files with commasinstead.) Regular expressions (wildcards) may be used to match multiple members; see above. Again, be sure to quote expressions that would otherwise beexpanded or modified by the operating system.
[-xxfile(s)]
An optional list of archive members to be excluded from processing.

Options

-1

list filenames only, one per line. This option excludes all others; headers, trailers and zipfile comments are never printed. Soundgarden super zip rar converter mac. It is intended for use in Unixshell scripts.

-2

list filenames only, one per line, but allow headers (-h), trailers (-t) and zipfile comments (-z), as well. This option may be usefulin cases where the stored filenames are particularly long.

-s

list zipfile info in short Unix 'ls -l' format. This is the default behavior; see below.

-m

list zipfile info in medium Unix 'ls -l' format. Identical to the -s output, except that the compression factor, expressed as apercentage, is also listed.

-l

list zipfile info in long Unix 'ls -l' format. As with -m except that the compressed size (in bytes) is printed instead of the compressionratio.

-v

list zipfile information in verbose, multi-page format.

-h

list header line. The archive name, actual size (in bytes) and total number of files is printed.

-M

pipe all output through an internal pager similar to the Unix more(1) command. At the end of a screenful of output, zipinfo pauses with a'--More--' prompt; the next screenful may be viewed by pressing the Enter (Return) key or the space bar. zipinfo can be terminated by pressing the'q' key and, on some systems, the Enter/Return key. Unlike Unix more(1), there is no forward-searching or editing capability. Also, zipinfodoesn't notice if long lines wrap at the edge of the screen, effectively resulting in the printing of two or more lines and the likelihood that some text willscroll off the top of the screen before being viewed. On some systems the number of available lines on the screen is not detected, in which case zipinfoassumes the height is 24 lines.

-t

list totals for files listed or for all files. The number of files listed, their uncompressed and compressed total sizes , and their overall compressionfactor is printed; or, if only the totals line is being printed, the values for the entire archive are given. The compressed total size does not include the 12additional header bytes of each encrypted entry. Note that the total compressed (data) size will never match the actual zipfile size, since the latter includesall of the internal zipfile headers in addition to the compressed data.

-T

print the file dates and times in a sortable decimal format (yymmdd.hhmmss). The default date format is a more standard, human-readable version withabbreviated month names (see examples below).

-U

[UNICODE_SUPPORT only] modify or disable UTF-8 handling. When UNICODE_SUPPORT is available, the option -U forces unzip to escape all non-ASCIIcharacters from UTF-8 coded filenames as '#Uxxxx'. This option is mainly provided for debugging purpose when the fairly new UTF-8 support is suspected tomangle up extracted filenames.

The option -UU allows to entirely disable the recognition of UTF-8 encoded filenames. The handling of filename codings within unzip falls backto the behaviour of previous versions.
-z

include the archive comment (if any) in the listing.

Detailed Description

zipinfo has a number of modes, and its behavior can be rather difficult to fathom if one isn't familiar with Unix ls(1) (or even if one is).The default behavior is to list files in the following format:The last three fields are the modification date and time of the file, and its name. The case of the filename is respected; thus files that come from MS-DOSPKZIP are always capitalized. If the file was zipped with a stored directory name, that is also displayed as part of the filename.

The second and third fields indicate that the file was zipped under Unix with version 1.9 of zip. Since it comes from Unix, the file permissions atthe beginning of the line are printed in Unix format. The uncompressed file-size (2802 in this example) is the fourth field.

The fifth field consists of two characters, either of which may take on several values. The first character may be either 't' or 'b', indicating thatzip believes the file to be text or binary, respectively; but if the file is encrypted, zipinfo notes this fact by capitalizing the character('T' or 'B'). The second character may also take on four values, depending on whether there is an extended local header and/or an 'extra field' associatedwith the file (fully explained in PKWare's APPNOTE.TXT, but basically analogous to pragmas in ANSI C--i.e., they provide a standard way to include non-standardinformation in the archive). If neither exists, the character will be a hyphen ('-'); if there is an extended local header but no extra field, 'l'; if thereverse, 'x'; and if both exist, 'X'. Thus the file in this example is (probably) a text file, is not encrypted, and has neither an extra field nor an extendedlocal header associated with it. The example below, on the other hand, is an encrypted binary file with an extra field:Extra fields are used for various purposes (see discussion of the -v option below) including the storage of VMS file attributes, which is presumablythe case here. Note that the file attributes are listed in VMS format. Some other possibilities for the host operating system (which is actually amisnomer--host file system is more correct) include OS/2 or NT with High Performance File System (HPFS), MS-DOS, OS/2 or NT with File Allocation Table (FAT)file system, and Macintosh. These are denoted as follows:File attributes in the first two cases are indicated in a Unix-like format, where the seven subfields indicate whether the file: (1) is a directory, (2) isreadable (always true), (3) is writable, (4) is executable (guessed on the basis of the extension--.exe, .com, .bat, .cmd and.btm files are assumed to be so), (5) has its archive bit set, (6) is hidden, and (7) is a system file. Interpretation of Macintosh file attributes isunreliable because some Macintosh archivers don't store any attributes in the archive.

Finally, the sixth field indicates the compression method and possible sub-method used. There are six methods known at present: storing (no compression),reducing, shrinking, imploding, tokenizing (never publicly released), and deflating. In addition, there are four levels of reducing (1 through 4); four typesof imploding (4K or 8K sliding dictionary, and 2 or 3 Shannon-Fano trees); and four levels of deflating (superfast, fast, normal, maximum compression).zipinfo represents these methods and their sub-methods as follows: stor; re:1, re:2, etc.; shrk; i4:2, i8:3,etc.; tokn; and defS, defF, defN, and defX.

The medium and long listings are almost identical to the short format except that they add information on the file's compression. The medium format liststhe file's compression factor as a percentage indicating the amount of space that has been 'removed':In this example, the file has been compressed by more than a factor of five; the compressed data are only 19% of the original size. The long format givesthe compressed file's size in bytes, instead:In contrast to the unzip listings, the compressed size figures in this listing format denote the complete size of compressed data, including the 12extra header bytes in case of encrypted entries.

Adding the -T option changes the file date and time to decimal format:Note that because of limitations in the MS-DOS format used to store file times, the seconds field is always rounded to the nearest even second. For Unixfiles this is expected to change in the next major releases of zip(1L) and unzip.

In addition to individual file information, a default zipfile listing also includes header and trailer lines:The header line gives the name of the archive, its total size, and the total number of files; the trailer gives the number of files listed, their totaluncompressed size, and their total compressed size (not including any of zip's internal overhead). If, however, one or more file(s) are provided,the header and trailer lines are not listed. This behavior is also similar to that of Unix's 'ls -l'; it may be overridden by specifying the-h and -t options explicitly. In such a case the listing format must also be specified explicitly, since -h or -t (or both) in theabsence of other options implies that ONLY the header or trailer line (or both) is listed. See the EXAMPLES section below for a semi-intelligibletranslation of this nonsense.

The verbose listing is mostly self-explanatory. It also lists file comments and the zipfile comment, if any, and the type and number of bytes in any storedextra fields. Currently known types of extra fields include PKWARE's authentication ('AV') info; OS/2 extended attributes; VMS filesystem info, both PKWAREand Info-ZIP versions; Macintosh resource forks; Acorn/Archimedes SparkFS info; and so on. (Note that in the case of OS/2 extended attributes--perhaps the mostcommon use of zipfile extra fields--the size of the stored EAs as reported by zipinfo may not match the number given by OS/2's dir command: OS/2always reports the number of bytes required in 16-bit format, whereas zipinfo always reports the 32-bit storage.)

Again, the compressed size figures of the individual entries include the 12 extra header bytes for encrypted entries. In contrast, the archive totalcompressed size and the average compression ratio shown in the summary bottom line are calculated without the extra 12 header bytes of encryptedentries.

Environment Options

Modifying zipinfo's default behavior via options placed in an environment variable can be a bit complicated to explain, due to zipinfo'sattempts to handle various defaults in an intuitive, yet Unix-like, manner. (Try not to laugh.) Nevertheless, there is some underlying logic. In brief, thereare three 'priority levels' of options: the default options; environment options, which can override or add to the defaults; and explicit options given bythe user, which can override or add to either of the above.

The default listing format, as noted above, corresponds roughly to the 'zipinfo -hst' command (except when individual zipfile members arespecified). A user who prefers the long-listing format (-l) can make use of the zipinfo's environment variable to change this default:

Unix Bourne shell:
ZIPINFO=-l; export ZIPINFO
Unix C shell:
setenv ZIPINFO -l
OS/2 or MS-DOS:
set ZIPINFO=-l
VMS (quotes for lowercase):
define ZIPINFO_OPTS '-l'
If, in addition, the user dislikes the trailer line, zipinfo's concept of 'negative options' may be used to override the default inclusion of theline. This is accomplished by preceding the undesired option with one or more minuses: e.g., '-l-t' or '--tl', in this example. The firsthyphen is the regular switch character, but the one before the 't' is a minus sign. The dual use of hyphens may seem a little awkward, but it's reasonablyintuitive nonetheless: simply ignore the first hyphen and go from there. It is also consistent with the behavior of the Unix command nice(1).

As suggested above, the default variable names are ZIPINFO_OPTS for VMS (where the symbol used to install zipinfo as a foreign command wouldotherwise be confused with the environment variable), and ZIPINFO for all other operating systems. For compatibility with zip(1L), ZIPINFOOPT is alsoaccepted (don't ask). If both ZIPINFO and ZIPINFOOPT are defined, however, ZIPINFO takes precedence. unzip's diagnostic option (-v with nozipfile name) can be used to check the values of all four possible unzip and zipinfo environment variables.

Examples

To get a basic, short-format listing of the complete contents of a ZIP archive storage.zip, with both header and totals lines, use only the archivename as an argument to zipinfo:

To produce a basic, long-format listing (not verbose), including header and totals lines, use -l:
To list the complete contents of the archive without header and totals lines, either negate the -h and -t options or else specify the contentsexplicitly:
(where the backslash is required only if the shell would otherwise expand the '*' wildcard, as in Unix when globbing is turned on--double quotes around theasterisk would have worked as well). To turn off the totals line by default, use the environment variable (C shell is assumed here):
To get the full, short-format listing of the first example again, given that the environment variable is set as in the previous example, it is necessary tospecify the -s option explicitly, since the -t option by itself implies that ONLY the footer line is to be printed:
The -s option, like -m and -l, includes headers and footers by default, unless otherwise specified. Since the environment variablespecified no footers and that has a higher precedence than the default behavior of -s, an explicit -t option was necessary to produce the fulllisting. Nothing was indicated about the header, however, so the -s option was sufficient. Note that both the -h and -t options, when usedby themselves or with each other, override any default listing of member files; only the header and/or footer are printed. This behavior is useful whenzipinfo is used with a wildcard zipfile specification; the contents of all zipfiles are then summarized with a single command.

To list information on a single file within the archive, in medium format, specify the filename explicitly:

The specification of any member file, as in this example, will override the default header and totals lines; only the single line of information about therequested file will be printed. This is intuitively what one would expect when requesting information about a single file. For multiple files, it is oftenuseful to know the total compressed and uncompressed size; in such cases -t may be specified explicitly:
To get maximal information about the ZIP archive, use the verbose option. It is usually wise to pipe the output into a filter such as Unix more(1) ifthe operating system allows it:
Finally, to see the most recently modified files in the archive, use the -T option in conjunction with an external sorting utility such as Unixsort(1) (and sed(1) as well, in this example):
The -nr option to sort(1) tells it to sort numerically in reverse order rather than in textual order, and the -k 7 option tells it tosort on the seventh field. This assumes the default short-listing format; if -m or -l is used, the proper sort(1) option would be -k8. Older versions of sort(1) do not support the -k option, but you can use the traditional + option instead, e.g., +6 insteadof -k 7. The sed(1) command filters out all but the first 15 lines of the listing. Future releases of zipinfo may incorporate date/timeand filename sorting as built-in options.

Tips

The author finds it convenient to define an alias ii for zipinfo on systems that allow aliases (or, on other systems, copy/rename theexecutable, create a link or create a command file with the name ii). The ii usage parallels the common ll alias for long listings inUnix, and the similarity between the outputs of the two commands was intentional.

Bugs

As with unzip, zipinfo's -M ('more') option is overly simplistic in its handling of screen output; as noted above, it fails to detectthe wrapping of long lines and may thereby cause lines at the top of the screen to be scrolled off before being read. zipinfo should detect and treateach occurrence of line-wrap as one additional line printed. This requires knowledge of the screen's width as well as its height. In addition, zipinfoshould detect the true screen geometry on all systems.

zipinfo's listing-format behavior is unnecessarily complex and should be simplified. (This is not to say that it will be.)

See Also

ls(1), funzip(1L), unzip(1L), unzipsfx(1L), zip(1L), zipcloak(1L), zipnote(1L),zipsplit(1L)

Url

The Info-ZIP home page is currently at

Topic

Hello,
I am trying to implement a simple script that ZIPs up a text file.
The problem is that I don't think the ZIPArchive is available on my server. Here is an example of my code:
Code: [Select]
<?php
$zip = new ZipArchive();
$filename = './PJR.v2.zip';
if ($zip->open($filename, ZIPARCHIVE::CREATE)!TRUE) {
exit('cannot open <$filename>n');
}
if ($handle = opendir('WORKDIR')) {
while (false ! ($entry = readdir($handle))) {
if ($entry != '.' && $entry != '.') {
$zip->addFile($entry);
}
}
closedir($handle);
}
$zip->close();
?>
When I run it from the command line, I get
Code: [Select]
PHP Fatal error: Class 'ZipArchive' not found in /users/albert/zip_POC.v2.php on line 2
This is the version info on my server:
Code: [Select]
php -v
PHP 5.1.6 (cli) (built: Nov 12 2008 11:22:53)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
Is there a way that I can install that class even though I am not the 'root' user??

Similar Tutorials



Similar TutorialsView Content
Hello,
I am trying to implement a simple script that ZIPs up a text file.
The problem is that I don't think the ZIPArchive is available on my server. Here is an example of my code:
Code: [Select]
<?php
$zip = new ZipArchive();
$filename = './PJR.v2.zip';
if ($zip->open($filename, ZIPARCHIVE::CREATE)!TRUE) {
exit('cannot open <$filename>n');
}
if ($handle = opendir('WORKDIR')) {
while (false ! ($entry = readdir($handle))) {
if ($entry != '.' && $entry != '.') {
$zip->addFile($entry);
}
}
closedir($handle);
}
$zip->close();
?>
When I run it from the command line, I get
Code: [Select]
PHP Fatal error: Class 'ZipArchive' not found in /users/albert/zip_POC.v2.php on line 2
This is the version info on my server:
Code: [Select]
php -v
PHP 5.1.6 (cli) (built: Nov 12 2008 11:22:53)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
Is there a way that I can install that class even though I am not the 'root' user??
Similar TutorialsView Content
im just a student and taking my on-the-job training.
i already ask my supervisor to help but she only said that i should research about that problem.
so this is the problem:
im working on a zip files
and it displays an error undefined function zip_open. i've posted here earlier and a moderator told me to read a link.
a zlib is already installed
i have read on http://www.php.net/manual/en/zip.installation.php and it said that
'In order to use these functions you must compile PHP with zip support by using the --enable-zip configure option.'
how can i compile php using the --enable-zip configure option.
help again pls.
i run this on linux
Similar TutorialsView Content
So I'm trying to mess around with the HttpRequest class and it can't be found. I looked it up and it said I have to enable the extension in the php.ini file but I couldn't find the php_http.dll extension that the website said I should be able to find and un-semicolon.
What exactly is a PHP HttpRequest? It seems like a few languages have this functionality. What is possible with the PHP HttpRequest, do I need other languages to get, send or display data through HttpRequest?
Thanks for any help.
Similar TutorialsView Content
Hi
This is a strange one, and I'm not sure whats going on here. I've tried googling the answer to no avail.
Basically, I'm writing a Wordpress plugin, and here's my setup:
install.php has a class called 'two_install'
The main plugin file code snippet:
Code: [Select]
// Installation
require(plugin_basename('installer.php'));
// Initiate installation class
$twp_install = new twp_install;
This results in this on activation:
Fatal error: Class 'twp_install' not found in path-on-serverwp-contentpluginstwitter_parsertwitter_parser.php on line xx
Anyone got any ideas? Just a note, there is definitely a class called 'twp_install' in installer.php!
Thanks in advance
Similar TutorialsView Content
I am using a PHP class for a web app that works perfectly well when developing on local machine (PHP 5.2) using the NuSphere IDE. NuSphere sees the class, and when I run the app locally everything seems to work, but when i port the app to the host (Linux Ubuntu with Apache2, PHP 5.3, MySQL 5.1 ), the class is not found (using the remote host debugger).
The exact mesage is: Class 'ExcelXML' not found at <line of code>.
Here is the code snippet:
Code: [Select]
<?php
function setExcelData($sql, $title, $fileName, $idref=0)
{
$retVal=false;
//$fileName=$fileName.'.xml';
$fileName=$fileName.'.xls';
include ('ExcelXML.inc.php');
include_once $_SERVER['DOCUMENT_ROOT'].'/truck/inc/db.inc.php';
$input = ($idref0?'blank1.xml':'blank.xml');
// create ExcelXML object
$xml = new ExcelXML();
// read template file
if (!$xml->read($input))
{
echo 'Failed to open Tempalate Excel XML file<br>';
}
..
?>
Here is the class
Code: [Select]
<?php
/**
* Class ExcelXML
* Provide functions to modify the content of file in Excel's XML format.
*
* REQUIRED:
* - An ExcelXML file as template
*
* FEATURES:
* - read, modify, and save Excel's XML file
* - create download stream as Excel file format (*.xls)
*
* CHANGELOG:
* 06-08-2008
* - Update setCellValue function
* - Fix setCellValue bug
* 13-07-2008
* - First created
*
*
* @author Herry Ramli (herry13@gmail.com)
* @license GPL
* @version 0.1.1
* @copyright August 06, 2008
*/
class ExcelXML
{
var $domXML;
var $activeWorksheet;
function ExcelXML()
{
}
..
?>
The class is in the same folder location as the calling php file. Any ideas? I don't get it.
Similar TutorialsView Content
Hi all. Just seeing this error now.funny enough the site have been live for about a week only to bring this error now! Fatal error: Class 'PDO' not found in /home/mysite/public_html/includes/file.php on line 21 and this is the file.phpi just saw this today and it's on godaddy thanks
Similar TutorialsView Content
hello, i am hoping someone can help, been working on my own mvc with help from tutorials, but i am stuck with this error:
Fatal error: Class 'services' not found in C:xampphtdocsWorkspaceCyberglidelibsBootstrap.php on line 27
were it says services that changes when i type a different item in the url, loads the error page but says that at the bottom of the page.
hoping someone can help me where i gone wrong:
Code: [Select]
<?php
class Bootstrap {
function __construct() {
$url = isset($_GET['url']) ? $_GET['url'] : null;
$url = rtrim($url, '/');
$url = explode('/', $url);
//print_r($url);
if (empty($url[0])) {
require 'controllers/index.php';
$controller = new Index();
$controller->index();
return false;
}
$file = 'controllers/' . $url[0] . '.php';
if (file_exists($file)) {
require $file;
} else {
$this->error();
}
$controller = new $url[0];
$controller->loadModel($url[0]);
// calling methods
if (isset($url[2])) {
if (method_exists($controller, $url[1])) {
$controller->{$url[1]}($url[2]);
} else {
$this->error();
}
} else {
if (isset($url[1])) {
if (method_exists($controller, $url[1])) {
$controller->{$url[1]}();
} else {
$this->error();
}
} else {
$controller->index();
}
}
}
function error() {
require 'controllers/error.php';
$controller = new Error();
$controller->index();
return false;
}
hope someone can help, many thanks guys.
Similar TutorialsView Content
This topic has been moved to PHP Applications.
http://www.phpfreaks.com/forums/index.php?topic=315284.0
Similar TutorialsView Content
Hi there, I'm trying to create a zip file from an array of images that are posted from a form using the following code:The php file is in a separate folder e.g. www.website.com/php/zip-test.php to the images folder as I want to be able to re-use it for other folders. I get as far as adding the files to the zip but when I try to close the zip it fails. The only thing I can think is that the $hostedFile is a relative link, e.g. /images/image1.jpg rather than http://www.website.c..ages/image1.jpg so it's not finding the image to add to the zip So I tried adding the full website path to the image but it still does not work. The image is displaying fine when I echo it as an image, it just doesn't add to the zip. Any ideas? Thanks, Bob
Similar TutorialsView Content
Hello folks, I am new to the forum.
I am having a problem on SBS 2011 creating a ZipArchive with PHP.
Although I have specified the filename to create as 'myzip.zip' the file created in the temp folder is 'myzip.zip.a10860'. If I try again immediately the file becomes 'myzip.zip.b10860' and then 'myzip.zip.c10860'. Of course the numbers will change if I wait a few minutes.
I have also tried creating the file first with fopen() then closing it and trying the ZipArchive::OVERWRITE. Still the same result
I have tried many standard scripts from the net as well as my own very basic script and always the same result.
PHP is set up through Fastcgi.
Any thoughts would be appreciated.
Michael

How To Access Method Object In Base Class From Derived Class? Error In My Solut

Similar TutorialsView Content
I have mysqli object in Database class base:
[color=]database class:[/color]
class Database {
private $dbLink = null;
public function __construct() {
if (is_null($this->dbLink)) {
// load db information to connect
$init_array = parse_ini_file('./init.ini.inc', true);
$this->dbLink = new mysqli($init_array['database']['host'],
$init_array['database']['usr'],
$init_array['database']['pwd'],
$init_array['database']['db']);
if (mysqli_connect_errno()) {
$this->dbLink = null;
}
}
}
public function __destruct() {
$this->dbLink->close();
}
}
Class derived is Articles where I use object dBLink in base (or parent) class and I can't access to mysqli methods (dbLink member of base class):
Articles class:
require_once ('./includes/db.inc');
class Articles extends Database{
private $id,
..
..
$visible = null;
public function __construct() {
// Set date as 2009-07-08 07:35:00
$this->lastUpdDate = date('Y-m-d H:i:s');
$this->creationDate = date('Y-m-d H:i:s');
}
// Setter
..
..
// Getter
..
..
public function getArticlesByPosition($numArticles) {
if ($result = $this->dbLink->query('SELECT * FROM articles ORDER BY position LIMIT '.$numArticles)) {
$i = 0;
while ($ret = $result->fetch_array(MYSQLI_ASSOC)) {
$arts[$i] = $ret;
}
$result->close();
return $arts;
}
}
}
In my front page php I use article class:
include_once('./includes/articles.inc');
$articlesObj = new articles();
$articles = $articlesObj->getArticlesByPosition(1);
var_dump($articles);
[color=]Error that go out is follow[/color]
Notice: Undefined property: Articles::$dbLink in articles.inc on line 89
Fatal error: Call to a member function query() on a non-object in articles.inc on line 89
If I remove constructor on derived class Articles result don't change
Please help me

Calling A Preexisting Instance Of A Class Inside Of Another Class?

Similar TutorialsView Content
I have an existing instance of my class Database, now I want to call that instance in my Session class, how would I go about doing this?

Ways Of Calling A Class's Method Inside Another Class

Similar TutorialsView Content
Ok. I know you can pass the object of a class as an argument. Example:
class A {
function test() {
echo 'This is TEST from class A';
}
}
class B {
function __construct( $obj ) {
$this->a = $obj;
}
function test() {
$this->a->test();
}
}
Then you could do:
$a = new A();
$b = new B($a);
Ok so that's one way i know of.
I also thought that you could make a method static, and do this: (assuming class A's test is 'static')
class B {
function test() {
A::test();
}
}
But that is not working.
I'd like to know all possible ways of accomplishing this. Any hints are appreciated. thanks

Calling Class Properties / Methods From A Different Class' Method?

Similar TutorialsView Content
Hi
Can you call Class A's methods or properties from Class B's methods?
Thanks.
Similar TutorialsView Content
I am making login system using codeigniter. When I run my code i get this error.
Code: [Select]
The requested URL /ci_login/user/login was not found on this server.
here is my code so far
user.php file which is in controller folder
Code: [Select]
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class User extends CI_Controller {
function __construct() {
parent::__construct();
}
function index() {
}
function login() {
if($this->form_validation->run() FALSE) {
$this->load->view('view_login');
} else {
echo 'Successfull';
}
}
}
view_login.php file which is in view folder
Code: [Select]
<html>
<head>
<title>Login</title>
</head>
<body>
<h1>Please Login!</h1>
<p>Use the login form below to login.</p>
<div>
<?php echo form_open(base_url(). 'user/login' ) ?>
<label>Username:</label>
<div>
<?php echo form_input(array('id' => 'username', 'name' => 'username')); ?>
</div>
<label>Password:</label>
<div>
<?php echo form_password(array('id' => 'password', 'name' => 'password')); ?>
</div>
<div>
<?php echo form_submit(array('name' => 'submit'),'Login'); ?>
</div>
<?php echo form_close(); ?>
</div>
</body>
</html>
help please how can I solve this error?

Calling Class When Class Name Is Build From Variables.

Similar TutorialsView Content
Hi,
I need to be able to call a class based on variables. E.G.
I would normally do:
Code: [Select]
$action = new pattern1()
but i would like to be able to do it dynamicaly:
Code: [Select]
$patNum = 1;
$action = new pattern.$patNum.()
Im wondering if that's possible? If so what would the correct syntax be?
Many Thanks.
Similar TutorialsView Content
This code works without problems:
But why the following code cause Fatal error: Class 'NamespaceBB' not found in ..file?
And this code also works without problems:Without any namespace, also Fatal error: Class 'B' not found in ..file:
Works without problems:And yes everything is in the same PHP file..
I'm trying to show my friend my website and it's not letting him or me view it.
I am using my own IP-address. (dashed out for security, but it is correct)
http://--.---.--.---/index-1.php
When he and I type this into our browser, we can an error called 'Resource Not Found'.
But, when I use localhost address, it works fine.
http://localhost/index-1.php
Does anyone know what is wrong?
Do I need to open a specific port?
USING XAMPP.
Hi every1,
I am quite a newbie in php so please bear with ma silly questions. I use IIS 6.0 . I have a php file named try.php .
content is as folows
<html>
<head>...</head>
<body>....som html code here..
<?php
if (flag0)
{
some html code
}
?>
..some html code
</body>
</html>
when i open the file it says
Error Summary
HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred.
Can anybody tell me what am i doing wrong.. It happen with me almost every now and then. Is there some conceptual mistake am doing?
Please clarify. If the same question has been discussed thousand times before, than do direct me to the proper link..
Regards,
Dwayne
Hi Folks! New to php and introduced into it by a new found friend who is really into php. Been learning and learning and learning but not so much I am afraid. I guess books and youtubes and other tutorials are not enough so here I am, fearlessly venturing into this forum and I hope to learn much more to all ya pros out there err I mean in here. Be gentle to me please. I am not a coder but I do have logical thinking attitude and habit. I am a slow learner and close to the resignation age. But who cares, I wanna learn php, yeah!
Fatal error: Call to undefined function curl_init() in C:(etc etc..)
Now I know the usual causes for a problem like this, but they are not solving anything.
Yes, extension=php_curl.dll is uncommented in the php.ini file.
Yes, phpinfo() displays the php.ini file I have been editing as the Loaded Configuration File.
Yes, extension_dir is set correctly in my php.ini file (other extensions work).
Yes, php_curl.dll exists in my ext/ folder.
No, phpinfo() does not display anything about cURL, anywhere
Where else can I look to possibly fix this?
Similar TutorialsView Content
I think this is a PHP topic rather than Javascript.
Can anyone tell me why this code cannot find the page (404 Not Found)
Code: [Select]
<?php
if ('{$row['passState']}' 0)
{
?>
<script language='javascript' type='text/javascript' >
<--
var newwindow;
function popupgo()
{
newwindow = window.open('check.php?quizTitle=<?php '.urlencode($quizTitle).'; ?>','_blank', 'scrollbars=yes,top=0,left=0,width='+screen.width+',height='+screen.height);
if (window.focus) {newwindow.focus()}
}
//-->
</script>
<?php
echo '<form><input type='button' value='Popup'></form>';
}
?>when this test code works fine? Both files are PHP.
Code: [Select]
<?php
?>
<head>
<script language='javascript' type='text/javascript' >
<--
var newwindow;
function popupgo()
{
newwindow = window.open('check/check.php?quizTitle=<?php '.urlencode($quizTitle).'; ?>','_blank', 'scrollbars=yes,top=0,left=0,width='+screen.width+',height='+screen.height);
if (window.focus) {newwindow.focus()}
}
//-->
</script>
</head>
<body>
<form>
<input type='button' value='Popup'>
</form>
</body>
<?php
?>
One more problem.. I'm sorry if I bother u.
I have:
echo 'Image: '.$json['Poster'].'; and if image exist I get in return URL.. but if there's no image get a error:
Notice: Undefined index: Poster in C:xampphtdocsfile.php on line 48
How can I show a message error for this?
Maybe I have too many questions but it's first time when I use PHP and don't understand too much.
Help is appreciated, again. Thanks!
I readed about if, else.. still can't solved.

http://bayarearcsociety.com/prototype/index.php
When I click the Home link in the nav panel I get these errors
Code: [Select]
Warning: include(/content/pages/testpage.php) [function.include]: failed to open stream:
No such file or directory in /home/bayare27/public_html/prototype/content/maincontent.php on line 7
Warning: include() [function.include]: Failed opening '/content/pages/testpage.php' for
inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/bayare27/php') in /home/bayare27
/public_html/prototype/content/maincontent.php on line 7
index.php
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' >
<head>
<meta http-equiv='Content-type' />
<meta http-equiv='Content-language' />
<link type='text/css' href='css/reset.css' />
<link type='text/css' href='css/960.css' />
<link type='text/css' href='css/custom.css' />
<title></title>
</head>
<body>
<div>
<div>
<div></div>
<div><?php include('content/newsflash.php'); ?></div>
</div>
<div><?php include('content/menu.php'); ?></div>
<div><?php include('content/maincontent.php'); ?></div>
<div id ='footer'><?php include('content/footer.php'); ?></div>
</div><!-- end wrapper -->
</body>
</html>
menu.php
<?php
?>
<div>
<ul>
<li><a href='<?php echo htmlentities($_SERVER['SCRIPT_NAME']); ?>?page=testpage'><span>Home</span></a></li>
<!-- Tried both these $_SERVER['PHP_SELF'] and $_SERVER['SCRIPT_NAME']-->
<li><a href='><span>About us</span></a></li>
<li><a href='><span>Schedule</span></a></li>
<li><a href='><span>Media</span></a></li>
<li><a href='><span>Products</span></a></li>
<li><a href='><span>Miscellaneous</span></a></li>
</ul>
</div>
testpage.php
<?php
?>
<p>
lalalaa
</p>
The file structure on the server is:
prototype
content - I know these are ok
pages - testpage.php is in this file
css - I know these are ok
images - I know this one is ok
Just don't know what to do next.
Thanks
I apologize, I thought I was posting in php. I assume you will move it.
Similar TutorialsView Content
I'm having trouble with a role in a wordpress site that I made
I think the script was that I installed another version, so I
some adjustments in it, among those changes have modified this function
Quote
if (@$_GET['src'] && !@$PHPTHUMB_CONFIG['allow_local_http_src'] && eregi('^http://'.@$_SERVER['HTTP_HOST'].'(.+)', @$_GET['src'], $matches)) {
$phpThumb->ErrorImage('It is MUCH better to specify the 'src' parameter as '.$matches[1].' instead of '.$matches[0].'.'.'nn'.'If you really must do it this way, enable 'allow_local_http_src' in phpThumb.config.php');
}
for this:
Quote
(@$_GET['src'] && !@$PHPTHUMB_CONFIG['allow_local_http_src'] && preg_match('^http://'.@$_SERVER['HTTP_HOST'].'(.+)', @$_GET['src'], $matches)) {
$phpThumb->ErrorImage('It is MUCH better to specify the 'src' parameter as '.$matches[1].' instead of '.$matches[0].'.'.'nn'.'If you really must do it this way, enable 'allow_local_http_src' in phpThumb.config.php');
}
It was supposed to make some images appear as thumbnails on the home page
my site, but they do not appear and I got the following error:
Quote
Warning: preg_match() [function.preg-match]: No ending delimiter '^' found in /home/pontocom/public_html/wp-content/themes/Comfy/scripts/phpThumb/phpThumb.php on line 160
Is there some way that I can take to fix this error?