php-general Digest 11 Feb 2003 18:55:28 -0000 Issue 1877

Topics (messages 135167 through 135223):

Regex Help
        135167 by: Lord Loh.
        135171 by: Ernest E Vogelsinger
        135173 by: Chris Hayes
        135183 by: Kevin Waterson

Re: Why use XML?
        135168 by: Ilya Nemihin

Re: " and ' giving problems
        135169 by: Michiel van Heusden

Re: How to use fopen() with protected directory (i.e .htaccess)
        135170 by: Ernest E Vogelsinger

Re: Newbie recursive directory
        135172 by: Chris Hayes

Objects: Cant set object variables with refrences ...
        135174 by: James
        135187 by: michael kimsal
        135189 by: James

File upload???
        135175 by: Kenneth Suralta
        135176 by: Francesco Leonetti

Q: File not rewritable - why? Help needed.
        135177 by: user.domain.invalid

How to check acces to modeuls files and dirs
        135178 by: Konference

Re: several buttons in form - which one was clicked
        135179 by: James

Session into class
        135180 by: ZioBudda

Q. on ereg_replace
        135181 by: Michiel van Heusden
        135186 by: Michiel van Heusden

If no record in MySQL how to?
        135182 by: Steve Jackson
        135184 by: Marek Kilimajer
        135185 by: Steve Jackson

Re: mac os 9 - file upload problems
        135188 by: Lowell Allen
        135195 by: Step Schwarz

Re: sorting multi-dimensional array where array elements are structs [simple class]
        135190 by: Erin Fry

help me
        135191 by: Cavallaro, Vito
        135219 by: Ray Hunter
        135220 by: Cavallaro, Vito
        135221 by: Ray Hunter

Image processing: tolerance of damaged files
        135192 by: Geoff Caplan

Problem with FTP and fopen
        135193 by: Chris Boget
        135194 by: Adam Voigt
        135196 by: Robin Mordasiewicz

Re: Directory size
        135197 by: Jeff Pauls

PHP can create, but not delete
        135198 by: Greg

Search Results - Web Page has Expired after Viewing Results
        135199 by: Vernon
        135201 by: Marek Kilimajer
        135208 by: Vernon
        135209 by: Chris Shiflett
        135210 by: Marek Kilimajer
        135213 by: Vernon

Alternative to PDFlib with PDI
        135200 by: Michael E. Barker

RSA implementation
        135202 by: José León Serna
        135215 by: Chris Hewitt

array_fill error
        135203 by: Erin Fry
        135205 by: Barajas, Arturo
        135207 by: Jason Wong

Help With Form Mail
        135204 by: WAW
        135211 by: Marek Kilimajer

PHP 4.3.0 + MSSQL database authentication problem?
        135206 by: Alan Murrell
        135216 by: Alan Murrell

Date check
        135212 by: Fredrik
        135214 by: Jon Haworth

Show the info to update depending on the selection
        135217 by: Miguel Brás

mail() and php.ini  (Any Luck???)
        135218 by: Scott Fletcher
        135222 by: Jason Wong

PHP FTP  a security risk?????
        135223 by: Christopher Ditty

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
I am new to regex and broke my head on it the other day...in vain...

Can any one tell me a place to get a step by step tutorial on it or help me
out on how to work it out ?

I am trying to make a link collector.

after opening the desired page, I want to get all the hyperlinks on it...

Thank You!
==========
~ Lord Loh ~
==========


--- End Message ---
--- Begin Message ---
At 07:47 11.02.2003, Lord Loh. said:
--------------------[snip]--------------------
>I am new to regex and broke my head on it the other day...in vain...
>
>Can any one tell me a place to get a step by step tutorial on it or help me
>out on how to work it out ?

http://www.php.net/manual/en/ref.pcre.php
http://www.perldoc.com/perl5.6/pod/perlre.html


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/


--- End Message ---
--- Begin Message ---
At 07:47 11-2-2003, you wrote:
I am new to regex and broke my head on it the other day...in vain...

Can any one tell me a place to get a step by step tutorial on it or help me
out on how to work it out ?
Some tutorials:
http://codewalkers.com/tutorials/30/3/ Codewalkers - Using PCRE
http://samuelfullman.com/team/php/working/regex.php PCRE - Samuel Fullman
http://www.yapf.net/faq.php?cmd=viewitem&itemid=113 How can i replace text between two tags
http://www.yapf.net/faq.php?cmd=viewitem&itemid=152 Counting words
http://www.phpbuilder.com/columns/dario19990616.php3 Learning to use Regular Expressions by example
http://www.phpbuilder.com/columns/dario19990616.php3?page=3 email addresses



I am trying to make a link collector.

after opening the desired page, I want to get all the hyperlinks on it...

--- End Message ---
--- Begin Message ---
This one time, at band camp,
"Lord Loh." <[EMAIL PROTECTED]> wrote:

> I am trying to make a link collector.
> 
> after opening the desired page, I want to get all the hyperlinks on it...

OK, this is quick and nasty, but you can add sanity/error checking etc
as you please, but it shows you the concept..

<?php

  // tell me its broken
  error_reporting(E_ALL);

class grabber{

  function grabber(){

}

function getLinks(){
  // regex to get the links
  $contents = $this->getUrl();
  preg_match_all("|http:?([^\"' >]+)|i", $contents, $arrayoflinks);
  return $arrayoflinks;
}

// snarf the url into a string
function getUrl(){
  return file_get_contents($_POST['url']);
}


} // end class
?>

<html>
<body>
<h1>Link Grabber</h1>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table>
<tr><td>URL:</td><td><input type="text" name="url" maxlength="100" size="50" 
value="http://www.php.net";></td></tr>
<tr><td><input type="submit" value="Grab em"></td></tr>
</table>
</form>

<?php
  // check something was posted
  if(!isset($_POST['url']) || $_POST['url']=='')
        {
        // or tell them to
        echo 'Please Enter a Valid url';
        }
  else
        {
        // create a new grabber
        $grab = new grabber;
        // snarf the links
        $arr=$grab->getLinks();
        // check the size of the array
        if(sizeof($arr['0'])=='0')
                {
                // echo out a little error
                echo 'No links found in file '.$_POST['url'];
                }
        else
                {
                // filter out duplicates and print the results
                foreach(array_unique($arr['0']) as $val){ echo '<a 
href="'.$val.'>'.$val.'<br />'; }
                }
        }
?>
</body></html>


enjoy,
Kevin
-- 
 ______                              
(_____ \                             
 _____) )  ____   ____   ____   ____ 
|  ____/  / _  ) / _  | / ___) / _  )
| |      ( (/ / ( ( | |( (___ ( (/ / 
|_|       \____) \_||_| \____) \____)
Kevin Waterson
Port Macquarie, Australia
--- End Message ---
--- Begin Message ---
> well Im out of a job so I am sitting around learning XML. It seems like a
> great tool, but I am trying to figure out why I would actually use it?

If you intersting for my experience:

I find xml+xslt useful for offline-site generation tasks,
right now I am making site, and there are folders
content\
  db\
  pages\
  xslt\

in 'db' I store 'pages.xml', 'news.xml' and 'common.xml'

f.e. 'pages.xml' - describe all pages of site:
<?xml version="1.0"?>
<pages>

  <page id="about">
    <name>about</name>
    <descr>more description</descr>
  </page>

  <page id="address">
    <name>address</name>
    <descr>more descritption</descr>
  </page>
...
</pages>

where <name> are going to menu and to page header, <descr> - this is 'title'
for <a>,

'news.xml' - news of site:
<?xml version="1.0"?>
<news>
<news-item>
  <date>01.01.2003</date>
  <text>opening site</text>
</news-item>
</news>

'common.xml' - common information about company (name, year, email, phones
...)
<?xml version="1.0" encoding="windows-1251"?>
<common>
  <year>2003</year>
  <name>Name of company</name>
  <slogan>slogan</slogan>
  <address>
    <line>russia/ekaterinburg</line>
    <line>street/building</line>
    <line>phone</line>
    <line>email</line>
  </address>
  <logo width="200" height="200" src="image.gif" title="title/>
</common>

directory 'pages' store each page as xml file,
f.e. 'about.xml':

<?xml version="1.0"?>
<page-content>
<p img="hands">
paragraph
</p>
</page-content>

then in folder 'xslt' are stored xslt files,
there is 'fp-page.xsl'
an 'site-page.xsl'

first - this is xslt-transformation for First Page (index.html)
second - this is xslt-transformation  for any page of site.

my php script make next - for each page of site
make one xml file, as aggregation of
pages.xml + common.xml + {idPage}.xml
and with this one xml file make site-page.xsl transformation and then save
this as file {idPage}.html

script have template:

<?xml version="1.0">
<page-of-site>
#add_elements_here#
</page-of-site>

and on #add_elements_here# it are placed that xml files,
also script placed tag <pageId>{idPage}</pageId>
where {idPage} - are real page's id ('about', 'address' ...)
by this tag xsl can determine what page he show, and make menu bar with
selected item,
and take from "page-of-site/pages/page[@id = $idPage]/name" (this is XPath)
name of page, for placing description of page.

content may contains any tags, and in xsl there is handlers for them, f.e. I
have 'price.xml',
and I have specific tags for price-list, and price line:

<?xml version="1.0"?>
<page-content>

<p>
<price-list>
  <price file="file1.zip">Things1</price>
  <price file="file2.zip">Things1</price>
</price-list>
</p>

</page-content>

and in site-page.xsl there is handler (tamplate in xslt term.) for this:
<xsl:template match="price-list" mode="content">
  <table border="0" cellpadding="3" cellspacing="3">
  <xsl:for-each select="price">
    <tr>
      <xsl:if test="position() mod 2 != 0">
        <xsl:attribute name="bgcolor">#eeeeee</xsl:attribute>
      </xsl:if>
      <td><xsl:value-of select="."/></td>
      <td><a href="{@file}" target="_blank"><xsl:value-of
select="@file"/></a></td>
    </tr>
  </xsl:for-each>
  </table>
</xsl:template>


hope this helps :)

Ilya

ps: may be in future I make my this project open-source.




--- End Message ---
--- Begin Message ---
you could use stripslashes or stripcslashes to remove the '\'-s, otherwise i
wouldn't know..

"Pag" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Hi,
>
> When a user wants to add a comment on my site and uses either " or  ', and
> when it gets printed out,  comes out as /" or /', either to the web page
or
> on a form to alter.
>
> The only "treatment" i give it after its submitted on the form is:
>
> $comentarioc = str_replace("\r\n", "\n", $comentarioc);
> $comentarioc = str_replace("\r", "\n", $comentarioc);
>
> Is there a way to solve this? So it can accept both " and ', and be able
> to alter/print it with no problem?
> Thanks.
>
> Pag
>
>


--- End Message ---
--- Begin Message ---
At 06:22 11.02.2003, Daevid Vincent said:
--------------------[snip]--------------------
>How can I pass in a user/pw to an fopen() (or something similar)?

You don't. fopen() doesn't access the server via HTTP. It's PHP that
executes this call, sitting at the server, using the servers file system
(except when opening a remote site, but that's a different story). If you
are allowed (by means of opsys rights and PHP admin limits, such as
safe_mode) to open the file it will be opened for you, even if it is not
within the virtual web server directory tree.

>I am trying to render a dynamic db/php page into a static .html page --
>or more specifically, I'm trying to email me back an html version of a
>report page on remote servers. The reports are located behind an
>https:// Apache user/pass authenticated directory.
>
>I tried:
>$file =
>fopen("https://username:[EMAIL PROTECTED]/admin/report.php","r";); 

You can't open a remote SSL location using fopen(). Have a look at cUrl to
accomplish this.

>If I try to do something like:
>$file = fopen("/www/htdocs/admin/report.php","r"); 
>
>But then the PHP isn't executed, it just dumps me the straight source
>code.

If you can open and read the report, there's only one more step to execute
it: use eval():

$fname = "/www/htdocs/admin/report.php"
$file = fopen($fname,"r"); 
if ($file) {
    $code = fread($file, filesize($fname));
    fclose($file);
    @eval($code);
}
else
    die "Can't open file $fname\n";


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/


--- End Message ---
--- Begin Message ---
At 23:28 10-2-2003, you wrote:
G'day all

I've been trying for a day or so to get a script to traverse all the levels
of a directory.
did you see the first user comment on http://nl.php.net/manual/nl/ref.dir.php ? may help!

With help from list archives and web sites I've come up
with this:

<?php

$the_array = Array();
$thedir = "/Users/kim/test/";
$handle = opendir($thedir);

while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && $file != ".DS_Store")
{
$the_array[] =  $thedir . $file;
}
}
closedir($handle);

foreach ($the_array as $i)
{
$fileinfo = fopen(($i), "r") OR die("Failed to open file $i");
$thedata = fread($fileinfo, filesize($i));
fclose($fileinfo);

echo "$i $thedata<br>";
}

?>

I've read lots f stuff about "if (is_dir($blah)" but I get a bit lost with
the navigation after that (I'm _real_ new to *nix as well).  Could someone
please help as to how it would fit into my script?

Cheers and thanks

kim


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
My problem is illistrated by the following test code:

class test {

        var $flag = 0;
        function getFlag() { return $this->flag; }

        var $t;

        function Init() {
                $c = new test;
                $this->t = $c;
                $c->flag = 1000;
        }

        function EchoFunc() { echo("=" . $this->t->getFlag()); }

}

$test = new test;
$test->Init();
$test->EchoFunc();

When run, the number 0 is returned. Given copying symantecs, this is what
you would expect. $c is initilized with flag=0, the next line takes a copy
of $c and puts it in $t, the next line sets flag=1000 on $c, but not on $t.

However I would like refernce semantics and the final output of this script
to be 1000. So I changed the line to "$this->t &= $c;" and suddenly I get
the error: "Fatal error: Call to a member function on a non-object in
/user/sh/jmb/Project/Wiki/Public_html/test.php on line 25"

Anyone have any help on what is happening?

Thanks,
James.




--- End Message ---
--- Begin Message ---
James wrote:
<snip>
However I would like refernce semantics and the final output of this script
to be 1000. So I changed the line to "$this->t &= $c;" and suddenly I get
the error: "Fatal error: Call to a member function on a non-object in
/user/sh/jmb/Project/Wiki/Public_html/test.php on line 25"

Anyone have any help on what is happening?

$this->t = &$c;

I dunno where &= comes from.  I see people using it many times,
but =& makes more sense imo.  The & is 'by reference', and putting
it explicitly in front of which variable is to be passed by
reference *seems* more logical to me.  Otherwise you could
end up with

$this->t &= $c.$d;

What's being passed by reference at that point?


Michael Kimsal
http://www.phphelpdesk.com
http://www.phpappserver.com
734-480-9961

--- End Message ---
--- Begin Message ---
"Michael Kimsal" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> James wrote:
> <snip>
> >
> > However I would like refernce semantics and the final output of this
script
> > to be 1000. So I changed the line to "$this->t &= $c;" and suddenly I
get
> > the error: "Fatal error: Call to a member function on a non-object in
> > /user/sh/jmb/Project/Wiki/Public_html/test.php on line 25"
> >
> > Anyone have any help on what is happening?
>
>
> $this->t = &$c;

This works great. Thanks.




--- End Message ---
--- Begin Message --- Hello everyone! =)

Can anybody help me with file uploading with PHP???
i tried uploading a file through...

<form action="save_upload.php" method="post">
<input type="file" name="userfile">
<input type="submit">
</form>

but, in save_upload.php, there is no $HTTP_POST_VARS['userfile'], or $HTTP_POST_VARS['userfile_name'], etc...

Can anybody help me with this...



--- End Message ---
--- Begin Message ---
You need to check the following variables:

$_FILES["userfile"]["tmp_name"];
$_FILES["userfile"]["size"];
$_FILES["userfile"]["name"];
$_FILES["userfile"]["type"];

Ciao
Francesco

----- Original Message ----- 
From: "Kenneth Suralta" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 11, 2003 10:49 AM
Subject: [PHP] File upload???


> Hello everyone! =)
> 
> Can anybody help me with file uploading with PHP???
> i tried uploading a file through...
> 
> <form action="save_upload.php" method="post">
> <input type="file" name="userfile">
> <input type="submit">
> </form>
> 
> but, in save_upload.php, there is no $HTTP_POST_VARS['userfile'], or 
> $HTTP_POST_VARS['userfile_name'], etc...
> 
> Can anybody help me with this...
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
Newbie question:

I try to modify a txt-file but get "not writable" error.
(just like in http://www.php.net/manual/en/function.fwrite.php )

I've tried to change the chmode but now I need some help.

All info welcome! Thanks in advance!

Paul Dunkel
--
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Good morning,

I have got an anrray:

$access[]["id"];
$access[]["name"];

and then I browse a "mode" dirs and I need to check if md5(directory_name)
exists in access array. I don't want to browse all dirs a list all subdirs
files and chech with access array like this:

// check where login user has access
while($temp = $db -> db_Fetch_Array($check)){
        $access[$count]["name"] = $temp["name"]; //mode name, eg. backup
        $access[$count]["id"] = $temp["id_mod"]; //id dir
        $count++;
}

$handle=opendir($ADMIN_DIR);
$allow = Array();

while (($mod_name = readdir($handle))!==false) {
   if(eregi("^(mod.)",$mod_name)){
      $mod_id = md5(strtolower($mod_name));
      $f_h=opendir($ADMIN_DIR.$mod_name);
      while (($file_name = readdir($f_h))!==false) {
         if ($file_name != "." && $file_name != ".." && 
!in_array($file_name,$non_files)) {
            foreach($access as $value){
               if($value["id"]==$file_name){
                  $allow[] = $file_name;
               }
            }
         }
      }
   }
}

Have you got some ideas how to solve this problem with lower system
requirements? Thank you for your answers.

jiri.nemec at menea.cz
http://www.menea.cz
ICQ: 114651500

--- End Message ---
--- Begin Message ---
Your way does strike me as a strange way to do things: I would favour many
forms with hidden values myself to but ...


<html>
<head><title><title></head>
<body>

<form action=test2.php method=get>
Press the red submit button!<br>
<input type=submit name=red value="Go!"><P>

Press the Blue submit button!<br>
<input type=submit name=blue value="Go!"><P>

But enter your name first!<br>
<input type=text name=name><p>

</form><hr>

Your name is <?php echo($_GET["name"]); ?>!<P>

<?php

if ($_GET["red"] == "Go!") { echo("You pressed the red button!"); }
if ($_GET["blue"] == "Go!") { echo("You pressed the blue button!"); }

?>

</body></html>






--- End Message ---
--- Begin Message ---
Hi, I want to write a session-class that use MySQL. I have write the
body of the class. The class open and close session,  write the "data"
from session to DB, but the function session_decode() does not want to
decode my data.

Here the session_set_save_handler:

session_set_save_handler(array($hnd, "open_session"),
                                       array($hnd, "close_session"),
                                       array($hnd, "read_session"),
                                       array($hnd, "write_session"),
                                       array($hnd, "destroy_session"),
                                       array($hnd, "gc_session")
                                      );

and this is the read_session:

   function read_session($sessionid)
    {
        global $_SESSION;
        zb_debug("Dentro read_session");
        zb_debug("Mi connetto al DB e prelevo la sessione");
        $query = "select value,last from session where id =
'".session_id()."'";
        $this->dbms->Exec_Query($query);
        if ($this->dbms->ReturnNum() == 0) {
            $session_exist = false;
        } else {
              zb_debug("la sessione esiste");
              $session_exist = true;
              $session = $this->dbms->ReturnNextObject();
              zb_debug("il valore nella sessione è ".$session->value);

              $expire = session_cache_expire();
              zb_debug("La sessione vale $expire secondi, restano
".(($session->last + $expire) - time())." secondi");
              if ( ($session->last + $expire) < time() ) {
                  zb_debug("La sessione è scaduta : ");
                  zb_debug("La cancello dal DBMS");
                  $query = "delete from session where id =
'".session_id()."'";
                  $this->dbms->Exec_Query($query);
                  zb_debug("Sessione cancellata");
                  //La sessione è scaduta.
                  $this->session_exist = false;
              } else {
                    session_decode($session->value);
                    //session_decode('id|i:0');
                    var_dump($_SESSION);
                    zb_debug("  ");
                }

          }

        return true;
    }


Plz help me.

PHP5-dev with Apache 1.3.27

bye

--- End Message ---
--- Begin Message ---
i'm creating sort of a very simple css-alike-thing for outputting html to
flash actionscript.
the php gets a string ($text) from the database, which look something like:
<h1>header 1 </h1> etc...

then, from a 'css' file it reads the strings $replace and $replacement

it looks something like:

   $number = count($arr_replace);
   $i = 0;

   do {

       $replace = stripcslashes($arr_replace[$i]);
       $replacement = stripcslashes($arr_replace[$i]);

       $text = ereg_replace($replace, $replacement, $text);

       $i++;

   } while ($i < $number);

this works fine, except that after the ereg_replace some newlines are
inserted. I could strip them, but then i'm also stripping the original
newlines (which were in the string already) so, i'd be happier finding a way
of using this script without ereg_replace inserting newline (i don't
understand why it does anyway)

any suggestions?


--- End Message ---
--- Begin Message ---
never mind it

i've solved it trimming the $replace and $replacement before using them in
ereg_replace()

thanks anyway


"Michiel Van Heusden" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> i'm creating sort of a very simple css-alike-thing for outputting html to
> flash actionscript.
> the php gets a string ($text) from the database, which look something
like:
> <h1>header 1 </h1> etc...
>
> then, from a 'css' file it reads the strings $replace and $replacement
>
> it looks something like:
>
>    $number = count($arr_replace);
>    $i = 0;
>
>    do {
>
>        $replace = stripcslashes($arr_replace[$i]);
>        $replacement = stripcslashes($arr_replace[$i]);
>
>        $text = ereg_replace($replace, $replacement, $text);
>
>        $i++;
>
>    } while ($i < $number);
>
> this works fine, except that after the ereg_replace some newlines are
> inserted. I could strip them, but then i'm also stripping the original
> newlines (which were in the string already) so, i'd be happier finding a
way
> of using this script without ereg_replace inserting newline (i don't
> understand why it does anyway)
>
> any suggestions?
>
>


--- End Message ---
--- Begin Message ---
I have a problem whereby I need to show links based on an ID which is in
a MySQL DB.
So if ID 1 exists I pull an array of links which are defined as
belonging to ID1. This works OK.
How though can I distinguish between ID's which are not in the DB. I
want to display something if there are no links also and don't know what
I'm doing wrong. I try to display table 1 listed below but just get
nothing returned with this command.
What am I doing wrong?

print "<td valign='top' align='right'><img
src='pictures/document_heading_blue.gif' border='0'>";
// link to documents
$link_sql = "select * from documents 
        where id = '$id'";
$link_result = mysql_query($link_sql);
while ($documents = mysql_fetch_array($link_result)) 
                {
                        if (!$documents["id"])
//If no ID in DB display table 1...
                        {
                        print "<table cellpadding='4'><tr><td
width='10'><img src='../images/nuoli_right_pieni.gif'
border='0'></td><td width='166'><a
href='mailto:[EMAIL PROTECTED]'>No supporting documents with this
article mail us for more information</a></td></tr></table>";
                        }
                        else
//Display table with array of linked files.
                        {
                        print "<table cellpadding='4'><tr><td
width='40'><img src='../images/adobepdf.gif' border='0'></td><td
width='136'><a href='$documents[url]'
class='greenlinks'>$documents[name]</a></td></tr></table>";
                        }
                }

// end check for documents

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159

--- End Message ---
--- Begin Message --- if there are no rows, the while condition will return false so the while block will never be executed, try

if(mysql_num_rows($link_result) ){
while($documents = mysql_fetch_array($link_result)) {
print "<table cellpadding='4'><tr><td
width='40'><img src='../images/adobepdf.gif' border='0'></td><td
width='136'><a href='$documents[url]'
class='greenlinks'>$documents[name]</a></td></tr></table>";
}
} else {
print "<table cellpadding='4'><tr><td
width='10'><img src='../images/nuoli_right_pieni.gif'
border='0'></td><td width='166'><a
href='mailto:[EMAIL PROTECTED]'>No supporting documents with this
article mail us for more information</a></td></tr></table>";
}

Steve Jackson wrote:

I have a problem whereby I need to show links based on an ID which is in
a MySQL DB.
So if ID 1 exists I pull an array of links which are defined as
belonging to ID1. This works OK.
How though can I distinguish between ID's which are not in the DB. I
want to display something if there are no links also and don't know what
I'm doing wrong. I try to display table 1 listed below but just get
nothing returned with this command.
What am I doing wrong?

print "<td valign='top' align='right'><img
src='pictures/document_heading_blue.gif' border='0'>";
// link to documents
$link_sql = "select * from documents where id = '$id'";
$link_result = mysql_query($link_sql);
while ($documents = mysql_fetch_array($link_result)) {
if (!$documents["id"])
//If no ID in DB display table 1...
{
print "<table cellpadding='4'><tr><td
width='10'><img src='../images/nuoli_right_pieni.gif'
border='0'></td><td width='166'><a
href='mailto:[EMAIL PROTECTED]'>No supporting documents with this
article mail us for more information</a></td></tr></table>";
}
else
//Display table with array of linked files.
{
print "<table cellpadding='4'><tr><td
width='40'><img src='../images/adobepdf.gif' border='0'></td><td
width='136'><a href='$documents[url]'
class='greenlinks'>$documents[name]</a></td></tr></table>";
}
}

// end check for documents

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159




--- End Message ---
--- Begin Message ---
Thanks Marek,

That is the solution I was looking for.

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159





> -----Original Message-----
> From: Marek Kilimajer [mailto:[EMAIL PROTECTED]] 
> Sent: 11. helmikuuta 2003 13:39
> To: Steve Jackson
> Cc: PHP General
> Subject: Re: [PHP] If no record in MySQL how to?
> 
> 
> if there are no rows, the while condition will return false 
> so the while 
> block will never be executed, try
> 
> if(mysql_num_rows($link_result) ){
>     while($documents = mysql_fetch_array($link_result)) {
>         print "<table cellpadding='4'><tr><td
>             width='40'><img src='../images/adobepdf.gif' 
> border='0'></td><td
>             width='136'><a href='$documents[url]'
>             
> class='greenlinks'>$documents[name]</a></td></tr></table>";
>     }
> } else {
>     print "<table cellpadding='4'><tr><td
>             width='10'><img src='../images/nuoli_right_pieni.gif'
>             border='0'></td><td width='166'><a
>             href='mailto:[EMAIL PROTECTED]'>No supporting 
> documents 
> with this
>             article mail us for more 
> information</a></td></tr></table>";
> }
> 
> Steve Jackson wrote:
> 
> >I have a problem whereby I need to show links based on an ID 
> which is 
> >in a MySQL DB. So if ID 1 exists I pull an array of links which are 
> >defined as belonging to ID1. This works OK.
> >How though can I distinguish between ID's which are not in the DB. I
> >want to display something if there are no links also and 
> don't know what
> >I'm doing wrong. I try to display table 1 listed below but just get
> >nothing returned with this command.
> >What am I doing wrong?
> >
> >print "<td valign='top' align='right'><img 
> >src='pictures/document_heading_blue.gif' border='0'>"; // link to 
> >documents $link_sql = "select * from documents
> >        where id = '$id'";
> >$link_result = mysql_query($link_sql);
> >while ($documents = mysql_fetch_array($link_result)) 
> >             {
> >                     if (!$documents["id"])
> >//If no ID in DB display table 1...
> >                     {
> >                     print "<table cellpadding='4'><tr><td
> >width='10'><img src='../images/nuoli_right_pieni.gif'
> >border='0'></td><td width='166'><a
> >href='mailto:[EMAIL PROTECTED]'>No supporting documents with this
> >article mail us for more information</a></td></tr></table>";
> >                     }
> >                     else
> >//Display table with array of linked files.
> >                     {
> >                     print "<table cellpadding='4'><tr><td
> >width='40'><img src='../images/adobepdf.gif' border='0'></td><td
> >width='136'><a href='$documents[url]'
> >class='greenlinks'>$documents[name]</a></td></tr></table>";
> >                     }
> >             }
> >
> >// end check for documents
> >
> >Steve Jackson
> >Web Developer
> >Viola Systems Ltd.
> >http://www.violasystems.com
> >[EMAIL PROTECTED]
> >Mobile +358 50 343 5159
> >
> >
> >  
> >
> 

--- End Message ---
--- Begin Message ---
> From: Jimmy Brake <[EMAIL PROTECTED]>
> 
> I have a file upload page that accepts file uploads from pretty much
> every browser and os EXCEPT any browser on mac os 9.  I have no idea
> why, any of you ever have problems with file uploads on mac os 9? How
> did you solve the issue.

I have no problems with file uploads using IE 5.1, Mac OS 9.2.

--
Lowell Allen

--- End Message ---
--- Begin Message ---
> I have a file upload page that accepts file uploads from pretty much
> every browser and os EXCEPT any browser on mac os 9.
[...]

Hi Jimmy,

I routinely use Mac OS 9.x and both Netscape 7 and IE 5.1 to upload files to
sites written in PHP.  I also maintain these sites.  The only problems I've
encountered are when users try to upload files with something funky in the
filename which I did not anticipate.

Is it possible that uploads are failing because your Mac users are uploading
files with no file extensions and this is somehow interfering with the code
you're using to process the file?  File extensions are not required on Mac
OS 9.x so it wouldn't be uncommon at all to find a Mac user uploading, say,
a PDF without a .pdf extension.  If you'd like to post a URL or some code
I'd be happy to take a look.

Hope this helps,
-Step

--- End Message ---
--- Begin Message ---
On Mon, 10 Feb 2003 16:23:10 -0600, you wrote:

>Hi.
> 
>I’m working with a multidimensional array where the data in the 
>array is a class (struct).  All the information is being stored correctly, 
>but I need to sort each “column” (AA0, BA0, etc. – see below) 
>by the fieldNo portion of the struct.
> 
>class fieldClass
>{
>    var $fieldNo;
>    var $srcLineNo;
>    var $data;
>}
[...]

Although I've never personally used it, I believe usort() is what you
need:

http://www.php.net/manual/en/function.usort.php

You would need to create a callback function, something like:

function cmp($a, $b) {
  if ($a->fieldNo == $b->fieldNo) { return 0; }
  return ($a->fieldNo > $b->fieldNo) ? 1 : -1;
}

usort($structArray, 'cmp');

----------------------------------------------------------------------------

Thanks for the reply.  I had already tried usort previously.  For some reason, there 
is no data for the array fields at all in the cmp function - not sure why.  Does 
anyone know?  All help is appreciated!  Thanks.

 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/2003
 
--- End Message ---
--- Begin Message ---
how i do  work php with xml?

In php3.ini add extension = php3_xml.dll but not work. is runnig on winnt
workstation


--- End Message ---
--- Begin Message ---
make sure that the php3_xml.dll is in your system path and it can be
found.

Ray

On Tue, 2003-02-11 at 07:38, Cavallaro, Vito wrote:
> how i do  work php with xml?
> 
> In php3.ini add extension = php3_xml.dll but not work. is runnig on winnt
> workstation
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
all *.dll are C:\PHP3 but internet explorer make unload the file.xml

-----Mensaje original-----
De: Ray Hunter [mailto:[EMAIL PROTECTED]]
Enviado el: martes 11 de febrero de 2003 15:06
Para: Cavallaro, Vito
Cc: [EMAIL PROTECTED]
Asunto: Re: [PHP] help me


make sure that the php3_xml.dll is in your system path and it can be
found.

Ray

On Tue, 2003-02-11 at 07:38, Cavallaro, Vito wrote:
> how i do  work php with xml?
> 
> In php3.ini add extension = php3_xml.dll but not work. is runnig on winnt
> workstation
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
The system needs to be able to find the dll so you might need to add
C:\PHP3 to your system path...



On Tue, 2003-02-11 at 11:05, Cavallaro, Vito wrote:
> all *.dll are C:\PHP3 but internet explorer make unload the file.xml
> 
> -----Mensaje original-----
> De: Ray Hunter [mailto:[EMAIL PROTECTED]]
> Enviado el: martes 11 de febrero de 2003 15:06
> Para: Cavallaro, Vito
> Cc: [EMAIL PROTECTED]
> Asunto: Re: [PHP] help me
> 
> 
> make sure that the php3_xml.dll is in your system path and it can be
> found.
> 
> Ray
> 
> On Tue, 2003-02-11 at 07:38, Cavallaro, Vito wrote:
> > how i do  work php with xml?
> > 
> > In php3.ini add extension = php3_xml.dll but not work. is runnig on winnt
> > workstation
> > 
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
Hi folks,

I have an image processing module for converting & resizing uploaded
images.

My customer has 1000s of images from various sources, and a
significant percentage are not 100% correct.

At present I am using ImageMagick, but it chokes if the image is in
any way damaged. At present the customer has to load the images into
PhotoShop and re-save, which seems to fix them most of the time.

Do any of the other Linux libraries, such as Netpbm, handle damaged
images more robustly? I would very much value any feedback - I don't
have a lot of time for testing...

Thanks

-- 

Geoff Caplan
Advantae Ltd

--- End Message ---
--- Begin Message ---
OK, I used the php ftp_put function successfully to upload a file. But
this is not what I need. I need to use the ftp_fput function to transfer
from a file pointer. This function failed to transfer the file with
Pureftp server but transfers successfully using Wu-ftp. Any ideas on why
Pureftp is failing to trasfer from a file point? I don't understand why
it would even know the difference. Possible a bug in PHP?

On Mon, 2003-02-10 at 13:30, Craig Jackson wrote:
> Anyone have any idea why this script cause a file to be created without
> the contents?
> 
> <script language="php">        
>         set_time_limit(1200);
>         $filename = "testthis";
>         $fp = fopen("ftp://user:pass@server/outbound/devel/$filename";,
> "w");
>         $tran_info = sprintf( "%-10s\n","testthis");      
>         echo "$tran_info";
>         fputs($fp, $tran_info );
>         fclose($fp);
> </script>
> 
> Using the latest version of pure-ftpd from source on Linux.
> -- 
> 
> Craig Jackson
> __________________________
> Wildnet Group LLC
> 103 North Park, Suite 110
> Covington, Lousiana 70433
> Office 985-875-9453
> __________________________
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-- 

Craig Jackson
__________________________
Wildnet Group LLC
103 North Park, Suite 110
Covington, Lousiana 70433
Office 985-875-9453
__________________________



--- End Message ---
--- Begin Message --- I don't think PHP checks to see what FTPD your running, it's probably a bug
in PureFTPD as opposed to PHP (since it works in WU).

On Tue, 2003-02-11 at 10:10, Chris Boget wrote:
OK, I used the php ftp_put function successfully to upload a file. But
this is not what I need. I need to use the ftp_fput function to transfer
from a file pointer. This function failed to transfer the file with
Pureftp server but transfers successfully using Wu-ftp. Any ideas on why
Pureftp is failing to trasfer from a file point? I don't understand why
it would even know the difference. Possible a bug in PHP?

On Mon, 2003-02-10 at 13:30, Craig Jackson wrote:
> Anyone have any idea why this script cause a file to be created without
> the contents?
>
> <script language="php">
> set_time_limit(1200);
> $filename = "testthis";
> $fp = fopen("ftp://user:pass@server/outbound/devel/$filename",
> "w");
> $tran_info = sprintf( "%-10s\n","testthis");
> echo "$tran_info";
> fputs($fp, $tran_info );
> fclose($fp);
> </script>
>
> Using the latest version of pure-ftpd from source on Linux.
> --
>
> Craig Jackson
> __________________________
> Wildnet Group LLC
> 103 North Park, Suite 110
> Covington, Lousiana 70433
> Office 985-875-9453
> __________________________
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--

Craig Jackson
__________________________
Wildnet Group LLC
103 North Park, Suite 110
Covington, Lousiana 70433
Office 985-875-9453
__________________________




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc

Attachment: signature.asc
Description: This is a digitally signed message part

--- End Message ---
--- Begin Message ---
no sure if this helps but i had a similar problem with php < 4.3 . Afeter
upgrading from 4.2.3 ftp worked fine.

On 11 Feb 2003, Adam Voigt wrote:

> I don't think PHP checks to see what FTPD your running, it's probably a
> bug
> in PureFTPD as opposed to PHP (since it works in WU).
>
> On Tue, 2003-02-11 at 10:10, Chris Boget wrote:
>
>     OK, I used the php ftp_put function successfully to upload a file.
>     But
>     this is not what I need. I need to use the ftp_fput function to
>     transfer
>     from a file pointer. This function failed to transfer the file with
>     Pureftp server but transfers successfully using Wu-ftp. Any ideas on
>     why
>     Pureftp is failing to trasfer from a file point? I don't understand
>     why
>     it would even know the difference. Possible a bug in PHP?
>
>     On Mon, 2003-02-10 at 13:30, Craig Jackson wrote:
>     > Anyone have any idea why this script cause a file to be created
>     without
>     > the contents?
>     >
>     > <script language="php">
>     >         set_time_limit(1200);
>     >         $filename = "testthis";
>     >         $fp =
>     fopen("ftp://user:pass@server/outbound/devel/$filename";,
>     > "w");
>     >         $tran_info = sprintf( "%-10s\n","testthis");
>     >         echo "$tran_info";
>     >         fputs($fp, $tran_info );
>     >         fclose($fp);
>     > </script>
>     >
>     > Using the latest version of pure-ftpd from source on Linux.
>     > --
>     >
>     > Craig Jackson
>     > __________________________
>     > Wildnet Group LLC
>     > 103 North Park, Suite 110
>     > Covington, Lousiana 70433
>     > Office 985-875-9453
>     > __________________________
>     >
>     >
>     >
>     >
>     ---------------------------------------------------------------------
>     > To unsubscribe, e-mail: [EMAIL PROTECTED]
>     > For additional commands, e-mail: [EMAIL PROTECTED]
>     --
>
>     Craig Jackson
>     __________________________
>     Wildnet Group LLC
>     103 North Park, Suite 110
>     Covington, Lousiana 70433
>     Office 985-875-9453
>     __________________________
>
>
>
>
>     --
>     PHP General Mailing List (http://www.php.net/)
>     To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

-- 
Robin Mordasiewicz
416-207-7012
UNIX Administrator
Primus Canada

--- End Message ---
--- Begin Message ---
You can try something like this. 

$dir = "dir";

function dirsize($checkdir) {
    $dh = opendir($checkdir);
    $size = 0;
    while (($file = readdir($dh)) !== false)
        if ($file != "." and $file != "..") {
            $path = $checkdir."/".$file;
            if (is_dir($path))
                $size += dirsize($path);
            elseif (is_file($path))
                $size += filesize($path);
        }
    closedir($dh);
 $formated_size = $size /1000;
    return $formated_size;
}

$getFolderSize = dirsize("/files/personal");


Jeff



----- Original Message ----- 
From: "Marek Kilimajer" <[EMAIL PROTECTED]>
To: "Antti" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, February 03, 2003 4:37 AM
Subject: Re: [PHP] Directory size


> there is no php function for this, you can use unix command du or do it 
> in a loop
> 
> Antti wrote:
> 
> > How do I get the directory size? Suppose there is a function for this.
> >
> > antti
> >
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

--- End Message ---
--- Begin Message ---
Hi-
I'm having a problem with deleting a Cyrus IMAP mailbox.  I can create the
mailbox just fine.  Any ideas on why I can't delete the mailbox?  Here is
some code that I got off this newgroup a few months ago:

   function deleteMailbox ($mailbox) {

      $existing_boxes = imap_listmailbox($this->stream, "{" .
$this->imap["host$
      if ( empty($existing_boxes) ) {
         $this->Error = "deleteMailbox(): mailbox does not exist.";
         return(false);
      }

      # Now we add the delete ACL to cyrus feature...
      if ( ! imap_setacl($this->stream, imap_utf7_encode($mailbox),
$this->imap$
         $this->Error = imap_last_error();
         return(false);
      }

      if ( imap_deletemailbox($this->stream, imap_utf7_encode("{" .
$this->imap$
         return(true);
      } else {
         $this->Error = imap_last_error();
         return(false);
      }

   }



--- End Message ---
--- Begin Message ---
I've successfully created a search and result page for a dating site which
off of the result page is a detail page for reviewing the profile online and
so forth.

The problem I'm having is once a user does his/her search they may come up
with a number of results which after reviewing one of the members details
the search has to be done over again. If a user uses the back arrow or if I
use a javascript that causes the user to go back one page they get the
typical "Web Page has Expired after Viewing Results" message.

Now I that I can create profiles that are viewed from a pop-up window, but
that's really not convent. Is there any way to for go the expired page
message so that a user can go back to their results? Or does anyone have any
suggestions on better handling this?

Thanks


--- End Message ---
--- Begin Message ---
Simple answer is - use GET method instead of POST for your searches

Vernon wrote:

I've successfully created a search and result page for a dating site which
off of the result page is a detail page for reviewing the profile online and
so forth.

The problem I'm having is once a user does his/her search they may come up
with a number of results which after reviewing one of the members details
the search has to be done over again. If a user uses the back arrow or if I
use a javascript that causes the user to go back one page they get the
typical "Web Page has Expired after Viewing Results" message.

Now I that I can create profiles that are viewed from a pop-up window, but
that's really not convent. Is there any way to for go the expired page
message so that a user can go back to their results? Or does anyone have any
suggestions on better handling this?

Thanks





--- End Message ---
--- Begin Message ---
When I do that I get syntax errors in the SQL

"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Simple answer is - use GET method instead of POST for your searches


--- End Message ---
--- Begin Message ---
--- Marek Kilimajer <[EMAIL PROTECTED]> wrote:
> Simple answer is - use GET method instead of POST for
> your searches

--- Vernon <[EMAIL PROTECTED]> wrote:
> When I do that I get syntax errors in the SQL

That obviously has nothing to do with what request method
you are using. You need to give more information if you
want any help.

Chris
--- End Message ---
--- Begin Message ---
Changing the method also implies changing $_POST to $_GET in your code.

Vernon wrote:

When I do that I get syntax errors in the SQL

"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

Simple answer is - use GET method instead of POST for your searches





--- End Message ---
--- Begin Message ---
That did it. Thanks (in all the years I have been doing this you think I
would have learned that already)

"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Changing the method also implies changing $_POST to $_GET in your code.


--- End Message ---
--- Begin Message --- I know of fpdf and am currently using it in one application.

But does anyone know if I can open other pdf files with fpdf and merge them into one big pdf file like can be done with PDFlib Import? Or; is there an alternative besides fpdf that does this in php?

TIA

Michael E. Barker

--- End Message ---
--- Begin Message ---
Hello:
  I'm looking for an RSA implementation, the ones I have found are
really slow, and I just want to:

generatekey
decrypt

the encryptfunction will be done in javascript, it's for a login system
without SSL.

Regards.

--- End Message ---
--- Begin Message ---
José León Serna wrote:

Hello:
 I'm looking for an RSA implementation, the ones I have found are
really slow, and I just want to:

generatekey
decrypt

the encryptfunction will be done in javascript, it's for a login system
without SSL.

Have you considered using on one-way MD5 hash instead? Again, it would need JS to do the client-side hashing (so JS on the client mandatory). In the server database keep the hashed values and compare them with what the client sends.

Keeping the hashed values in the database is more secure than unencrypted passwords, and you don't want to look at users' passwords anyway, do you?

Just a thought, in case you had not yet considered it. The archives from a week or so ago will have something on this, I remember it being discussed.

HTH
Chris


--- End Message ---
--- Begin Message ---
I am trying to initialize a large array with all values being 0.  I’ve tried:
 
$arr = array_fill(0, 99, 0);
 
and I get this error message:
Fatal error: Call to undefined function: array_fill()
 
Any information and suggestions will be greatly appreciated.
 
Thanks.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/2003
 
--- End Message ---
--- Begin Message ---
Try "array" only:

$arr = array(0, 99, 0);

print_r($arr);

HTH
--
Un gran saludo/Big regards...
   Arturo Barajas, IT/Systems PPG MX (SJDR)
   (427) 271-9918, x448

> -----Original Message-----
> From: Erin Fry [mailto:[EMAIL PROTECTED]]
> Sent: Martes, 11 de Febrero de 2003 10:47 a.m.
> To: [EMAIL PROTECTED]
> Subject: [PHP] array_fill error
> 
> 
> I am trying to initialize a large array with all values being 
> 0.  I’ve tried:
>  
> $arr = array_fill(0, 99, 0);
>  
> and I get this error message:
> Fatal error: Call to undefined function: array_fill()
>  
> Any information and suggestions will be greatly appreciated.
>  
> Thanks.
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/2003
>  
> 
--- End Message ---
--- Begin Message ---
On Wednesday 12 February 2003 00:46, Erin Fry wrote:
> I am trying to initialize a large array with all values being 0.  I’ve
> tried:
>
> $arr = array_fill(0, 99, 0);
>
> and I get this error message:
> Fatal error: Call to undefined function: array_fill()
>
> Any information and suggestions will be greatly appreciated.

Did you try reading the manual to see whether your version of PHP supports 
this function?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The disks are getting full; purge a file today.
*/

--- End Message ---
--- Begin Message ---
Hello All,
I have a problem. I did this form mail script and it is sending the
email to the poster not the email specified in the $mailto. Can someone
help me. Sorry it will be long, the code that is:
CODE:
<?
//File_name = send_form.php//
 
include "header.htm";
include "setup.php";
 
$msg .= "Senders Name:  \t$_POST[senders_name]\n";
$msg .= "Senders Email: \t$_POST[senders_email]\n\n";
$msg .= "Message:       \t$_POST[message]\n\n";
$msg .= "From:          \t$_POST[senders_name]\n\n";
$mailheader .= "Reply To:  \t$_POST[senders_email]\n\n";
 
mail($mailto, $mailsubj, $msg, $mailheader);
?>
<html>
<head>
<title>Email Sent Successfully!!!</title>
</head>
<body>
<center><H2>The Following E-Mail Has Been Sent Successfully:</H2>
<p><strong>Your Name:</strong><br>
<? echo "$_POST[senders_name]"; ?>
<p><strong>Your Message</strong><br>
<? echo "$_POST[message]"; ?>
<br>
<br>
<? include "footer.htm"; ?></center>
</body>
</html>
 
And Here is the include file (setup):
<?
//File_Name = "setup.php"//
 
//Change below to your email address//
$mailto = "[EMAIL PROTECTED]";
 
//change below to your subject//
$mailsubj = "FeedBack";
 
//change below to the Subject you want in the email,//
//LEAVE THE \n AT THE END//
$msg .= "Email Feedback From Site\n";
?>
 
Thanks in advance!! :-)  I am new at the PHP programming thing, so bare
with me.
 
Thanks, WAW
 <http://reptilians.org/> http://reptilians.org
Forums:  <http://reptilians.org/boards> http://reptilians.org/boards 
 <http://allscripts.reptilians.org>
http://allscripts.reptilians.org/cgi-bin/index.cgi
 
--- End Message ---
--- Begin Message ---
mail($mailto, $mailsubj, $msg, $mailheader);

- where does $mailto come from?



WAW wrote:

Hello All,
I have a problem. I did this form mail script and it is sending the
email to the poster not the email specified in the $mailto. Can someone
help me. Sorry it will be long, the code that is:
CODE:
<?
//File_name = send_form.php//

include "header.htm";
include "setup.php";

$msg .= "Senders Name: \t$_POST[senders_name]\n";
$msg .= "Senders Email: \t$_POST[senders_email]\n\n";
$msg .= "Message: \t$_POST[message]\n\n";
$msg .= "From: \t$_POST[senders_name]\n\n";
$mailheader .= "Reply To: \t$_POST[senders_email]\n\n";

mail($mailto, $mailsubj, $msg, $mailheader);
?>
<html>
<head>
<title>Email Sent Successfully!!!</title>
</head>
<body>
<center><H2>The Following E-Mail Has Been Sent Successfully:</H2>
<p><strong>Your Name:</strong><br>
<? echo "$_POST[senders_name]"; ?>
<p><strong>Your Message</strong><br>
<? echo "$_POST[message]"; ?>
<br>
<br>
<? include "footer.htm"; ?></center>
</body>
</html>

And Here is the include file (setup):
<?
//File_Name = "setup.php"//

//Change below to your email address//
$mailto = "[EMAIL PROTECTED]";

//change below to your subject//
$mailsubj = "FeedBack";

//change below to the Subject you want in the email,//
//LEAVE THE \n AT THE END//
$msg .= "Email Feedback From Site\n";
?>

Thanks in advance!! :-) I am new at the PHP programming thing, so bare
with me.

Thanks, WAW
<http://reptilians.org/> http://reptilians.org
Forums: <http://reptilians.org/boards> http://reptilians.org/boards <http://allscripts.reptilians.org>
http://allscripts.reptilians.org/cgi-bin/index.cgi




--- End Message ---
--- Begin Message ---
Hello,

Because I am not sure if this is just a PHP issue or a
PHP+DB issue, I will be posting this message
(seperately) to bith the "General" and "PHP-DB" lists.

First, a brief rundown of my setup:

Mandrake Linux 9.0
Apache 1.3.27
PHP 4.3.0

We are in the process of rebuilding our outdated
servers, and all sites have been moved over
successfully, except our own, which has a Control
Panel login.  The login authentication is done using
FreeTDS to an MSSQL 2000 database.

This setup works fine on the current server, but when
I test it on the new server, the authentication seems
to work fine, but instead of the screen I normally see
when logging in, I just get kicked back to the Control
Panel login screen.

At first, I suspected FreeTDS, but I have confirmed
that a connection is definately being made by enabling
and examining the "dump" file.  The FreeTDS mailing
list has confirmed that this is also the case.

The current (working) server is running Apache 1.3.27
+ PHP v4.1.2 .  I had a similar problem on the current
working server when I tried upgrading the PHP to
v4.2.3 just before Xmas.

I have not yet tried "downgrading" to v4.1.2 on the
new server, but I would rather not.

I am not really sure where to proceed from here.  I
can provide any further information you need, or can
possibly provide a "Test" account if you wish to see
for yourself what it is doing, which may give some
ideas as to what is happening.

Is there perhaps some logging variables I can enable
in the Control Panel PHP script to see what is going
on?

Thank you, in advance, for your help and advice in
this matter.

Sincerely,

Alan Murrell <[EMAIL PROTECTED]>


______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca
--- End Message ---
--- Begin Message ---
Hi R'Twick,

--- R'twick Niceorgaw <[EMAIL PROTECTED]> wrote:
> check the register_globals in php.ini file.

In the 'php.ini' file on both servers (the current
working one, and the one I am having problems with),
'register_globals' is 'On'.

Actually, i did compare the two 'php.ini' files line
by line, and they are exact.  Just to be sure, i even
copied over the 'php.ini' file from the working
server, restarted Apache, and tried the Control Panel
again; still no joy :-(

Thank you for the suggestion, however!

Alan


______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca
--- End Message ---
--- Begin Message ---
Hi

I have to dates that i want to check who is biggest.

This does not work:

if( $date1 > $date2){
....

How can i check them?


Svein Olai



--- End Message ---
--- Begin Message ---
Hi Fredik,

> I have to dates that i want to check who is biggest.
> 
> This does not work:
> if( $date1 > $date2){
> ....
> 
> How can i check them?

Presumably they're in SQL format, or something similar? 

The easiest way is to convert them to unix timestamps (look into the date()
and mktime() functions to see how this is done).

Timestamps are integers representing the number of seconds since 1st January
1970, so comparisons are extremely easy :-)

Cheers
Jon
--- End Message ---
--- Begin Message ---
Hi,

I have a page that is intendend to update a table field on DB

i have a drop down menu wich displays all the position fields available on
db and a text area where i will insert the new data.

now the problem:

I'm using the query SELECT * FROM table WHERE position = $position

the $position is the choosen option from the drop down menu.

then have echo "<textarea>$functions</textarea>" where it will show to me
the present data available on DB

after all this, i have another query
UPDATE table SET functions = $functions WHERE position = $position

All is ok and working except the fact that he doesn't displays $functions
when selecting a option from the drop down menu?

Any help out there?

Miguel


--- End Message ---
--- Begin Message ---
Hi Everyone!!!!

The webserver is a Unix machine.  I don't want to send the email from the
Unix machine, I want to do that from Window.  So, if I configure hte php.ini
to find the MS-Exchange on Window and use it to send the email while the
webpage is on the Unix webserver, such as form fill out and click the send
button.

Have anyone try this and does it work?  Anyone struggle with it??  I'm going
to go ahead and do it.

Thanks,
 Scott F.


--- End Message ---
--- Begin Message ---
On Wednesday 12 February 2003 02:12, Scott Fletcher wrote:

> The webserver is a Unix machine.  I don't want to send the email from the
> Unix machine, I want to do that from Window.  So, if I configure hte
> php.ini to find the MS-Exchange on Window and use it to send the email
> while the webpage is on the Unix webserver, such as form fill out and click
> the send button.
>
> Have anyone try this and does it work?  Anyone struggle with it??  I'm
> going to go ahead and do it.

It wouldn't work. On Unix, mail() uses the sendmail binary and ignores any 
SMTP setting. You can get yourself a mail class from www.phpclasses.org which 
can use SMTP regardless of whether you're on Unix or Windows.

Anyway, what is the reason for using an external mailserver?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Mausoleum:  The final and funniest folly of the rich.
-- Ambrose Bierce
*/

--- End Message ---
--- Begin Message ---
Hello all.  I have a customer that purchased on of my scripts and
attempted
to install it on their server.  This script, among other things, FTPs a
text file 
from a central server.  When we tried to run my script, it simply
stops.  No
errors, no nothing.  I talked to his host and found out that they do
not allow
PHP FTP because it is a security risk.  ?????  Ummmm, ok?

I spoke with my customer about this and below is what his web host told
him.
My understanding of PHP FTP is that my script opens an ftp connection
from
the server to another FTP server somewhere else on the internet. 
Basically, 
PHP FTP does nothing more than a program like SmartFTP or WS-FTP.  Even

the first line in the PHP manual about FTP says "The functions in this
extension 
implement client access to file servers speaking the File Transfer
Protocol (FTP)"

Someone please tell me that I am correct and that this webhost is
wrong.  :)

Chris

>>>>>>>>
I have been speaking with our linux techs, and have gained a more
complete understanding of the feature in PHP that you want to use.  We
actually did have it enabled at one point, and it caused the server to
be compromised.  Essentially, it allows people on a machine to be able
to transfer files from anywhere on the internet.  This begs for people
who want to run warez sites, and the like, to hack the server, and use
it for their own illegal software stores.  The level of permission
required to allow this to run allows people to essentially load, and
run
whatever they want.  This is an EXTREME security problem. I understand
that you are moving, and I cannot persuade you differntly, but please
take my advise and do some independant research.  The individual that
is
advising you about this program is downplaying some real problems. It
is
the opinion of our techs, that if you are running this, eventaully,
you
WILL be hacked.  There a plenty of things that can be done to ftp to a
machine without that functionality running. 
 
   We know that you have a number of sites, and we know that you would
likely referr business.  That being the case, it just doesn't make
sense
that we would not do this for you if it were safe, or even a minor
problem.  It is a big problem, not just with us, but with anyone
running
it on the internet.  Please ask someone other than the person that is
trying to sell it to you.  That is all we ask. 
>>>>>>>>



--- End Message ---

Reply via email to