Re: [PHP] set var in PHP

2001-07-18 Thread Slavomir Slizik

Hello,

it isn't regular html, it is only server-parsed stuff .. Server Side
Includes.
You won't need that in PHP, just do:






blah blah blah ..


SSL



On Wed, 18 Jul 2001, jessica lee tishmack wrote:

> In html, I can do
>
> 
>
> How do I do this in PHP?
>
> Thanks,
> Jessica
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] file upload

2001-07-19 Thread Slavomir Slizik

Try to incerease 'max_execution_time' in your php.ini file - if your
connection is too slow, script execution time expires before the file is
uploaded. Increasing max_execution_time might help.
Try to increase max_filesize in your upload _form_, too.

Slavko


On Thu, 19 Jul 2001, Marcus wrote:

> -BEGIN PGP SIGNED MESSAGE-
>
> Hi everyone,
> I try to upload a file to my webserver, extract the email-adresses it
> contains and write these into a mysql database.
> Working with small files (<350 Kb) this works perfect. But trying to
> do this with files bigger than that fails. The files are never
> uploaded.
> I allready increased the "max_filesize" flag in php.ini to 8MB (!).
> Still it doesn´t work
>
> Does anyone have a clue??
>
>
> Thanx in advance
>
> -BEGIN PGP SIGNATURE-
> Version: PGPfreeware 6.5.8 for non-commercial use 
>
> iQEVAwUBO1aKZ1iXvbAP3AzNAQHHYAf+IJEJ0efrj0+EikPSQ5stXlrEQ3lCHDJl
> 5viGZfY8fuOS4eD3/L/ttrRllCtOrojCPjDk7vGEQnWJhokJW1ijOelumpOMvRAS
> AJnGyxMN+kxOle2umSkrZvhkMIqpbBJiR8ePhoCQW6xkLf3R/uiB1i7Duclm1ONm
> cwMy9VuzpNYNTBD4KhPBov7FC9SRBl9PIGYQqRmAss2r1YBv5Exo39NM8VW2sCKr
> Z+zSpYKLUzF2va215/9UWHSUmHcAw6Go6qHrjE9bbhJnoURif+8kdr18xMu6TGBx
> Mbb1397PapIxYnOYN5lbBeWNfNl7iLAj0upCwrBVpTmSlQ0m7R4z2Q==
> =enfp
> -END PGP SIGNATURE-
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Prevent user to close web browser

2001-07-19 Thread Slavomir Slizik

So, try to surf some free erotic,porn sites. They're full of that
window-spawing stuff :(

slavko


On Thu, 19 Jul 2001, kath wrote:

> Not with PHP.  Maybe some Javascript could.
>
> But why would you want this?  Planning some infinite spawning pop up website?
> =)
>
> - k
>
> On Thursday 19 July 2001 08:28 am, you wrote:
> > Hello,
> >
> > I need to prevent user to close the web browser on close button or by
> > pressing ALT+F4.
> >
> > Is this possible?
> >
> > Thanks,
> > Mihailo.
> >
> >
> > _
> > Do You Yahoo!?
> > Get your free @yahoo.com address at http://mail.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Sessions + Variables + includes

2001-07-19 Thread Slavomir Slizik

On the title page:

session_register("loggedin");
then:
session_start(); on every page
better to test session availability on every page:
if (!session_is_registered("loggedin")) {
// redirect user to title page where the session is registered
}

But your method of handling sessions and logins is very strange and
insecure :)

slavko


On Thu, 19 Jul 2001, dosenbrei wrote:

>
>
> Hi
>
> Sorry for my bad english ;-)
>
> I'm writing an application using php and sessions.
> In the first include file i'm writing something like this
>
> session_start();
> session_register(loggedin);
>
> The i have another include file with the functions.
> When i'm submitting the username and passwort to the function
> which checks them i'd like to set loggedin to 1 how does this work?
>
> function CheckLogin($username,$password)
> {
> if($username=='test' && $password=='user')
> {
> $loggedin=1;
> header("location:secretpage.php");
> }
> else
> {
> $loggedin =0;
> header("location:login.php")
> }
>
> Can i user include with sessions or doe i have to use requiere?
> I also tried to set the $loggedin to 1 this way:
>
> $HTTP_SESSION_VARS[loggedin]=1;
>
> This doesn't work too.
>
> Please help me
>
>
> THX
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Session problems

2001-07-19 Thread Slavomir Slizik

Hello,

check out if you have cookies turned on. Or, compile php with
--enable-trans-sid, where the PHPSESSID is automatically attached to all
URLs and forms without using cookies.
try to do session_register() before session_start() in 1.php, or do not
use session_start() in 1.php (only session_register()).

slavko


On Thu, 19 Jul 2001, Bernie Kruger wrote:

> Hi,
>
> I use this simple session script below,  but the session variables are not
> carried over from 1.php to 2.php.  What can be wrong?  I can see on the
> server that the files are created.  When I open 1.php a 1K file is created
> on the server and the contents (my_session_variable|s:10:"some value";).
> When I open 2.php afterwards a 0K file is created on the server which is
> empty.
>
> I use IIS5, Win2k, PHP 4.0.5, IE5.5.
> Session method: files
>
> (1.php)
>
>  session_start();
> $my_session_variable = "some value";
> session_register("my_session_variable");
> ?>
>
> and
>
> (2.php)
>
>  session_start();
> print "Value of 'my_session_variable': $my_session_variable";
> ?>
>
> Tx
> BK
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] fopen - warnings

2001-07-27 Thread Slavomir Slizik


...
if ($datei = @fopen($file[$i], "r+"))
...


On Thu, 26 Jul 2001, Vanessa wrote:

> Hello List,
>
> this is probably a very stupid question, but I dont know how to solve this
> little problem:
> I have a script with which text files (exported access db data sheets) can
> be uploaded to the mysql tables.
> It all works fine, but very annoyingly I get warning messages, if the text
> file is not resident on the server. But I want it in a way that it doesnt have
> to be on the server...a catch. The php manual says that if the file
> cannot be opened fopen returns false. All nice and good working, but I get
> those additional warning messages. Im not sure if it has maybe something
> to do with the server, but I am not convinced. Ill put the code below.
> Any suggestions are highly appreciated (I tried die command but it somehow
> messed up the routine).
>
> [schnipp]
>
> $file = array ("colours.txt", "categories.txt", "stockmain.txt",
> "stockcolours.txt");
> $i = 0;
> while ($file[$i])
> {
> //öffne das textfile
>  $datei = "";
>
>  if ($datei = fopen($file[$i], "r+"))
>  {
>  $zaehler = 0;
> //check wieviele zeilen das textfile hat
> //um zu verhindern, dass es leer ist!
>  while (!feof ($datei)) //liest jede zeile einzeln mit fget()
>  {
>  $buffer = fgets($datei, 1000);
>  //echo $buffer;
>  //echo "";
>  $zaehler++;
>  } //end while (!feof ($datei))
>
>  // MORE CODE AFTER THIS
>  // .
>
>  }
>  else
>  {
> ?>
>  
>  The file  could not be
> opened: no Mysql insert.
>  
>   }
>  $i++;
>  if ($datei)
>  { fclose($datei); }
> }
>
> [/schnipp]
>
> Warning messages are:
>
> Warning: fopen("categories.txt","r+") - No such file or directory in *some
> directory* on line 32
>
>
> I hope anybody can help...
>
> - Nessi -
>
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] 2D array

2001-07-27 Thread Slavomir Slizik

or:

$my2darray[] = $row;

SSL


On Fri, 27 Jul 2001, Wagner Tomy wrote:

> $my2darray = Array();
>
> while($row = mysql_fetch_row($result)) {
>   array_push($my2darray, $row);
> }
>
> OR:
>
> for($i = 0; $i < mysql_num_rows($result); $i++) {
>   $row = mysql_fetch_row($result);
> $my2darray[$i] = $row;
> }
>
> Wagner Tomy
> Editus S.A.
>
> - Original Message -
> From: "AJDIN BRANDIC" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, July 27, 2001 2:18 PM
> Subject: [PHP] 2D array
>
>
> > Hi
> >
> > I have been trying to do this for hours now.
> > I have a while loop (rows from mysql db) and on each pass I want to pussh
> > a new element into a 2D array, bot always end up with the last element of
> > the while loop.  So:
> >
> > table mytable
> > myname myphone myemail
> > john   254688  [EMAIL PROTECTED]
> > tom789787  [EMAIL PROTECTED]
> >
> > $myquery="select * from mytable";
> >
> > while ($myrow = mysql_fetch_array($myrows)) {
> >   .. .. . .  .
> >
> >   $my2darray = array ($myname => array ($myphone,$myemail));
> >
> > }
> >
> > $mycount=count(my2darray);  // returns 1
> >
> > while (list($key,$value) = each ($my2darray)) {
> >   echo"$key,";
> >   echo"$value[0]";
> >   echo"$value[1]";
> >   // retuns only one row with tom,798779,[EMAIL PROTECTED]
> > }
> >
> > How do I push multiple entries into a 2d array?
> >
> > I tried $my2darray[]=array(...
> >
> > Regards
> >
> > Ajdin
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] not null

2001-08-08 Thread Slavomir Slizik

if (empty($value)) { ... }


On Wed, 1 Aug 2001, Craig Vincent wrote:

>
> > When a field is declared as an integer, not null and is the primary,
> > how would I address it's empty set?
> >
> > ex: if($value == ???)
> > {
> > bla
> > bla
> > bla
> > }
> >
> >
> > My condition wants there to be nothing in $value.
>
> Are you referring to the (INT, NOT NULL, PRIMARY) field being in a database?
>
> Sincerely,
>
> Craig Vincent
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]