php-windows Digest 17 Jul 2002 20:08:39 -0000 Issue 1246

Topics (messages 14807 through 14823):

Fopen on ascii files
        14807 by: Mathias B

Function problem
        14808 by: Jan Hančič

delete a file
        14809 by: j.a.z.
        14810 by: j.a.z.

CRON JOB
        14811 by: MAAS
        14822 by: Svensson, B.A.T. (HKG)

Re: [PHP] CRON JOB
        14812 by: Jay Blanchard
        14815 by: Miguel Cruz

Accessing Network Shares and Mapped Drives
        14813 by: James Mclean

Re: compiling with VC++
        14814 by: Brian Huff

Restart process from code?
        14816 by: Noah Spitzer-Williams

Re: Problem on file_exists() function
        14817 by: Ross Fleming

Searching a string for everything but a-z and 0-9
        14818 by: Matt Babineau
        14819 by: Shrock, Court

Re: [PHP] Restart process from code?
        14820 by: Noah Spitzer-Williams
        14821 by: Noah Spitzer-Williams

Problem in passing parameters
        14823 by: Lung

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 ---
Hello

Quick question: what happens if i try to open a ascii-file/text-file with
fopen($file, 'wb'); on a windows system? does the file get scrambled because
of the 'b' or is the 'b' just ignored?

/Mathias


--- End Message ---
--- Begin Message ---
Hi

I hawe the following script :

<?
include("glava.php");


///////// FUNKCIJE ///////////

/*

Funkcija ki preveri če je URL prave oblike

*/

function je_url($url) {
        
        if (ereg("^http://*";, $url))
        
        {
                return TRUE;
                
        }
        
        else
        {
        return FALSE;
        }
        
}


function preveri($vir, $vir_url) {

        if ($vir || ( $vir && je_url($vir_url)) || (!$vir && !$vir_url))
        {
        return true;
        }
        
        else
        {
        return false;
        }
        
        
}
        

        
/*

Funkcija ki najrpej preveri če je s podatki vse vredu in jih ptoem doda v bazo

*/

        

function dodaj() {
        
        
        if($_POST['naslov'] && $_POST['vsebina'] && $_POST['avtor'] && 
$_POST['datum'] && preveri($_POST['vir'], $_POST['vir_url']))
        
        {
                
                $naslov = strip_tags($_POST['naslov'], "<b><i><a><img><u><p><br>");
                $vsebina = strip_tags($_POST['vsebina'], "<b><i><a><img><u>");
                $avtor = strip_tags($_POST['avtor'], "<b><i><a><img><u>");
                $datum = $_POST['datum'];
                $vir = $_POST['vir'];
                $vir_url = $_POST['vir_url'];
        
          $query = "insert into novice_novice (novica_naslov, novica_vsebina, 
novica_avtor, novica_datum, novica_vir, novica_vir_url)
                values('$naslov', '$vsebina', '$avtor', '$datum', '$vir', '$vir_url')";
                
          MYSQL_QUERY($query) or
                die (MYSQL_ERROR());
                
          echo "Novica vnešena !";
          echo "<br>Čez 3 sekunde boste preusmerjeni na glavni meni !";
        
          ?>
        
          <script>
                        window.setTimeout("document.location.href='./main.php'", 3000);
                </script>
                
                <?
                
                
        
        }
        else
        {
                echo "Nisi vpisal vseh podatkov! Ali pa je URL napačen.!";
                
                ?>
                
                <script>
                        window.setTimeout("history.go(-1)", 3000);
                </script>
                
                <?
                
                
        }
        
}

/////// KONEC FUNKCIJ /////////

                        
if($_COOKIE['prijava'] == "prijavljen")
        {
                
         ?>
        
         <title>Administracija novic : Dodajanje novic</title>
        
         <?
        
         MYSQL_CONNECT("localhost", "user", "password") or
                die (MYSQL_ERROR());
        
         MYSQL_SELECT_DB("nuke") or
                die(MYSQL_ERROR());
        
         dodaj();
        
        }
        
        else
        {
        
        ?>
        
                <script>document.location.href='./prijava.php';</script>

        <?
        
                
        }
        
?>



The problem is that this scipt alow to insert the news in to the database, 
even if the url is not correct.

All fileds exspect vir and vir_url must contanit something.
If vir_url is filed the vir must be field to, but if vir is filed it is not 
necesarry to vir_url to be filed.
Bu tif vir_url is fild it must be a vaild URl with http:// at teh begiinig.

But this script inserts the news even if teh URL is not in the corrret format.



LP
JaN
www.3delavnica.com
www.ks-con.si

--- End Message ---
--- Begin Message ---
hi

does anybody know how to delete a file?
you are able to generate a file with fwrite. you can open a file with fopen.
however i found no command to delete a generated file?

thanx, j.a.z.


--- End Message ---
--- Begin Message ---
thanks for all answers.

however in my php-referenz (book) they sad:
        unlink does not take effect on windows system
thats why i did not try this function!
but it worked well. thank you. (PS: the dummy-entry "delete" did NOT work)
:-)
jaz




"J.A.Z." <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hi
>
> does anybody know how to delete a file?
> you are able to generate a file with fwrite. you can open a file with
fopen.
> however i found no command to delete a generated file?
>
> thanx, j.a.z.
>
>


--- End Message ---
--- Begin Message ---

What do I have to do before I can run my file.php as a cron job in Linux?



--- End Message ---
--- Begin Message ---
% man crontab 

-----Original Message-----
From: MAAS
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: 2002-07-17 14:51
Subject: [PHP-WIN] CRON JOB


What do I have to do before I can run my file.php as a cron job in
Linux?




-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
[snip]
What do I have to do before I can run my file.php as a cron job in Linux?
[/snip]

Look at the archives for the past couple of days, it has been covered in
some detail. Make sure to compile PHP without apsx, and for practical
purposes move the PHP executable to the /usr/local/bin directory. Then put
this as the first line of the PHP file you want to run from a CRON;

#!/usr/local/bin/php

Then set up your CRON.

HTH!

Jay

"Philosophy is a study that lets us be unhappy more intelligently."

*************************************
* Want to meet other PHP developers *
* in your area? Check out:          *
* http://php.meetup.com/            *
* No developer is an island ...     *
*************************************


--- End Message ---
--- Begin Message ---
On Wed, 17 Jul 2002, Jay Blanchard wrote:
> Look at the archives for the past couple of days, it has been covered in
> some detail. Make sure to compile PHP without apsx, and for practical
> purposes move the PHP executable to the /usr/local/bin directory. Then put
> this as the first line of the PHP file you want to run from a CRON;
> 
> #!/usr/local/bin/php
> 
> Then set up your CRON.

Might want to add the -q flag to the php bangpath invocation.

miguel

--- End Message ---
--- Begin Message ---
hello list,

I just built a site to run on IIs5 and php 4.2.?, and it had to fopen()
files over a network. I have had some problem with accessing the files over
the network, and I am fairly sure, that is an issue with Windows users,
rather than PHP etc, but just thought some of you fellas could help or
provide some insight.

Basically what I have is this...
<ascii type=art quality=poor>

internet link
============> Win2k Webserver
                                        |
                                        | Internal Network
                                        |
                                Win2K ADC
                                Network Shares mapped to this box.

</ascii>

Now the IIS Anon user (IUSR_WEB-SERVER) has no trouble reading a file from
any where on the local file system, (C:) but over a network no go. fopen()
always gets permission denied. I have tried adding the permissions on the
drive F:, but thats no fun with over 20GB on that drive...

Im fairly stumped, (i have almost no windows experience, why cant the world
just use Unix?), i will probly just beg and grovel for one of our resident
windows junkies to fix it in the end....

Webserver is IIS 5, Both OS's are Windows 2000 Server.

Cheers

James Mclean

--- End Message ---
--- Begin Message ---

It sounds like you are not linking into the proper DLLs so that your 
custom DLL can be built.  It sounds like you need to add the entry 
"php4ts_debug.lib" or "php4ts.lib" to your linkage list.

The easiest way to do this is to open up your ".dsp" file in a text 
editor, and add them to the line that begins with "# ADD LINK32". 
Alternatively, you can go to Project / Settings in Visual C++, and in 
the "Link" tab, you can add it to the field "Object/library modules" 
with all the other DLLs

I have no idea what VC++ looks like in German...

Another good idea is to just open up one of the other ".dsp" files for 
one of the other extensions in the "src/ext/" directory, and compare 
your settings with an extension that compiles properly. That's probably 
the best way to get started.

Another gotcha... you should see in your ".c" file this code:

#ifdef COMPILE_DL_TEST
ZEND_GET_MODULE(test)
#endif

or something similar, depending on what you named your extension. Be 
sure to set "COMPILE_DL_TEST" in your compiler directives, or your 
extension wont run... also be sure to set "ZTS=1", unless you explicitly 
want to use the non-thread-safe version of the Zend engine... but I dont 
know why anybody would want to do that...

Again, all other extensions already do this... you should familiarize 
yourself with a simple one if you get stuck again.

-- 

Brian 'Bex' Huff
[EMAIL PROTECTED]
Phone: 952-903-2023
Fax: 952-829-5424

> hi there, 
> 
> as i said yesterday, i had some problems compiling the example-code for an
> extension. now i solved these probs, but now i have a new error:
> 
> test.obj : error LNK2001: no defined external symbol "__declspec(dllimport)
> int __cdecl zend_parse_parameters(int,char *,...)"
> (__imp_?zend_parse_parameters@@YAHHPADZZ)
> 
> now, what means this ?
> 
> greets,
> 
> Marco Glatz


--- End Message ---
--- Begin Message ---
Is there a way to restart a process (actually the process to handle ASP
pages) from code?

- Noah


--- End Message ---
--- Begin Message ---
It's likely a permissions problem under NT.

> -----Original Message-----
> From: Jack [mailto:[EMAIL PROTECTED]]
> Sent: 17 July 2002 08:55
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP-WIN] Problem on file_exists() function
> 
> 
> Dear all
> I had made a test.txt file which stored in the following window path :
> c:\pdf_reports\dealing\test.txt,
> In my page, i ask php to check the test.txt exist in foler
> (c:\pdf_reports\dealing) using the following script:
> 
> if (file_exists("c:\\pdf_reports\\dealing\\test.txt"))
>     {
>     print ("exist");
>     }
> else
>     {
>     print ("Doesn't Exist!");
>     }
> 
> It seems that php can't detect the file in such path!!!
> I had made another test on this, i moved the test.txt to one 
> level up which
> is (c:\pdf_reports) and i use the following script :
> 
> if (file_exists("c:\\pdf_reports\\test.txt"))
>     {
>     print ("exist");
>     }
> else
>     {
>     print ("Doesn't Exist!");
>     }
> Then it can detect the file is there! why?
> 
> 
> --
> Thx a lot!
> Jack
> [EMAIL PROTECTED]
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
--- End Message ---
--- Begin Message ---
Cold Fusion has RegEx to do this with. If I want to search a string
looking for anything non 0-9 and non a-z what should I be looking at?
Could I do:
 
$EXPR = "non a-z, non numerical";
strstr($SEARCH_STRING, $EXPR)
 
I hope this makes sense, I am not sure what PHP calls this type of
searching but in Cold Fusion it is called REGEX. Any suggestions on
where I can look in the php documentation to read more about this?
 
Matt Babineau
MCWD / CCFD
-----------------------------------------
e:  <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
p: 603.943.4237
w:  <http://www.criticalcode.com/> http://www.criticalcode.com
PO BOX 601
Manchester, NH 03105
 
--- End Message ---
--- Begin Message ---
preg_match('/[^a-z0-9]/i', $stringToSearch);

http://www.php.net/preg_match

> -----Original Message-----
> From: Matt Babineau [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, July 17, 2002 10:56 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Searching a string for everything but a-z and 0-9
> 
> 
> Cold Fusion has RegEx to do this with. If I want to search a 
> string looking for anything non 0-9 and non a-z what should I 
> be looking at? Could I do:
>  
> $EXPR = "non a-z, non numerical";
> strstr($SEARCH_STRING, $EXPR)
>  
> I hope this makes sense, I am not sure what PHP calls this 
> type of searching but in Cold Fusion it is called REGEX. Any 
> suggestions on where I can look in the php documentation to 
> read more about this?
>  
> Matt Babineau
> MCWD / CCFD
> -----------------------------------------
> e:  <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
> p: 603.943.4237
> w:  <http://www.criticalcode.com/> 
> http://www.criticalcode.com PO BOX 601 > Manchester, NH 03105
>  
> 
--- End Message ---
--- Begin Message ---
But I would like to restart the process.... as in it's currently running and
I want to end it and then start it again...


 - Noah

----- Original Message -----
From: "John Holmes" <[EMAIL PROTECTED]>
To: "'Noah Spitzer-Williams'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 2:18 PM
Subject: RE: [PHP] Restart process from code?


> You can use exec(), as long as the user PHP is running as has permission
> to execute the program...
>
> ---John Holmes...
>
> > -----Original Message-----
> > From: Noah Spitzer-Williams [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 17, 2002 1:20 PM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: [PHP] Restart process from code?
> >
> > Is there a way to restart a process (actually the process to handle
> ASP
> > pages) from code?
> >
> > - Noah
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--- End Message ---
--- Begin Message ---
How do I end the process using exec? Is there an equivalent to NET STOP?

- Noah

----- Original Message -----
From: "John Holmes" <[EMAIL PROTECTED]>
To: "'Noah Spitzer-Williams'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 2:28 PM
Subject: RE: [PHP] Restart process from code?


> So? Use exec(). Use it twice if you have to. If you can run a command on
> the command line, then you can run it through exec. Only difference is
> if the user PHP is running as can run the command.
>
> ---John Holmes...
>
> > -----Original Message-----
> > From: Noah Spitzer-Williams [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 17, 2002 2:10 PM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; php-
> > [EMAIL PROTECTED]
> > Subject: Re: [PHP] Restart process from code?
> >
> > But I would like to restart the process.... as in it's currently
> running
> > and
> > I want to end it and then start it again...
> >
> >
> >  - Noah
> >
> > ----- Original Message -----
> > From: "John Holmes" <[EMAIL PROTECTED]>
> > To: "'Noah Spitzer-Williams'" <[EMAIL PROTECTED]>;
> > <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Wednesday, July 17, 2002 2:18 PM
> > Subject: RE: [PHP] Restart process from code?
> >
> >
> > > You can use exec(), as long as the user PHP is running as has
> permission
> > > to execute the program...
> > >
> > > ---John Holmes...
> > >
> > > > -----Original Message-----
> > > > From: Noah Spitzer-Williams [mailto:[EMAIL PROTECTED]]
> > > > Sent: Wednesday, July 17, 2002 1:20 PM
> > > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > > Subject: [PHP] Restart process from code?
> > > >
> > > > Is there a way to restart a process (actually the process to
> handle
> > > ASP
> > > > pages) from code?
> > > >
> > > > - Noah
> > > >
> > > >
> > > >
> > > > --
> > > > 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,

  I have built a form for inputting username & password and called login.php
to handle. However, I fail to pass the variables to index.php like:
http://localhost/php/login.php?username=test&password=test. When I check the
variables in login.php, it said these variables are unset. Please adivse how
to solve it! I am using IIS & PHP 4.2.1 in Window 2000.
  Thanks!

Lung



--- End Message ---

Reply via email to