Re: [PHP] Includes inside includes

2003-12-21 Thread Website Managers.net
To call the file from anywhere within the document space, try this:

include($_SERVER[DOCUMENT_ROOT]./common/setup.inc);

Jim

- Original Message - 
From: Robbert van Andel [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, December 21, 2003 1:41 AM
Subject: [PHP] Includes inside includes


| I've written a class that is calling an include
| function to include a setup file.  The problem is that
| the setup file is in another directory than the class.
|  I'm including the file using:
| 
| include (../common/setup.inc);
| 
| Is there a way that i can make the relative path
| inside the class definition specific to the class
| definition, not the page that is including the class
| definition.  I have trouble when I include the class
| definition.  I get an error that it cannot include
| ../common/setup.ini whenever the class is called
| from a directory above common.
| 
| I hope this makes sense. and thanks for your help.
| 
| Robbert van Andel
|   
| 
| __
| Do you Yahoo!?
| New Yahoo! Photos - easier uploading and sharing.
| http://photos.yahoo.com/
| 
| -- 
| 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



Re: [PHP] [posibleOT] Forcing entering te site thru index.php

2003-12-21 Thread Website Managers.net
Cookies are a possibility but not always functional. Many people have them shut off, 
or services like WebTV do not support them. Two other possibilities are seccions and 
POST variables.

_SESSIONS_
forma2.php
if((!isset($_SESSION[username]) || (!isset($_SESSION[password])) {
 header(Location:index.php);
}

__ POST __   
// check to make sure username and password are entered and if so, they must match 
account
if ((!$_POST[username]) || (!$_POST[password]) || ($_POST[username != myuser) 
|| ($_POST[password] != mypassword])) {
header(Location:index.php);
}

Jim
www.websitemanagers.net

- Original Message - 
From: Fernando M. Maresca [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, December 21, 2003 12:57 PM
Subject: [PHP] [posibleOT] Forcing entering te site thru index.php


| Hello everybody.
| Well, i'm trying to avoid access to the site for the middle. Say there
| is a initial page with a form and other pages that depends on this. Is
| there a way to force users access the site thru the initial form page,
| regardless of the url?
| Something like this:
| lynx http://mysite/forma2.php/
| produce the browser to redirect to 
| http://mysite/index.php/
| 
| Of course, the forma2.php must be served if its accesed after index.php.
| Thanks
| 
| -- 
| 
| Fernando M. Maresca
| 
| Cel: (54) 221 15 502 3938
| Cel: 0221-15-502-3938
| 
| -- 
| 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



Re: [PHP] newbie question about header()

2003-12-21 Thread Website Managers.net
Unless you're using an 'if' statement, the header redirect must be the first line of 
the page, above any HTML markup.

Jim
www.websitemanagers.net

- Original Message - 
From: Scott Taylor [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, December 21, 2003 8:04 PM
Subject: [PHP] newbie question about header()


| 
| 
| I am simply trying to redirect users from one page to another.  Yet when 
| I use this code I get the following error:
| 
| *Warning*: Cannot add header information - headers already sent by 
| (output started at 
| /usr/local/psa/home/vhosts/miningstocks.com/httpdocs/etc/php/login/admin/test.php:8) 
| in 
| */usr/local/psa/home/vhosts/miningstocks.com/httpdocs/etc/php/login/admin/test.php* 
| on line *9*
| *
| *
| 
| html
| head
| /head
| 
| body
| 
| ?php
| header('Location: http://www.slashdot.org/'); /* Redirect browser */
| 
| /* Make sure that code below does not get executed when we redirect. */
| exit;
| ?
| 
| /body
| /html
| 
| 
| 
| I know the workaround with the meta tag (meta http-equiv=REFRESH 
| content=0; URL=http://www.slashdot.org/;, but I just don't understand 
| what I am doing wrong here.  I'm sure someone here knows
| 
| Thank you in advance,
| 
| Scott Taylor
| [EMAIL PROTECTED]
| 
| -- 
| 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



Re: [PHP] Re: Domain Check script

2003-12-20 Thread Website Managers.net
Try adding $ext onto the end of str_replace like this:
$a_query = (str_replace(www., , $a_query)...$_POST[ext]);
$a_query = (str_replace(http://;, , $a_query)...$_POST[ext]);

Jim

- Original Message - 
From: Cesar Aracena [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, December 20, 2003 2:30 PM
Subject: [PHP] Re: Domain Check script


| Ok... I found it... but not quite what I like. I found this function (thanks
| to WebWorkz) that needs not only the domain name but also the extension to
| be written. I changed the form a little bit so the extension is selected by
| the visitor from a drop down menu but I don't know what to change in the
| function to use it. Here it is:
| 
| function whois ($a_server, $a_query, $a_port=43)
| {
| $available = No match;
| $a_query = str_replace(www., , $a_query);
| $a_query = str_replace(http://;, , $a_query);
| 
| $sock = fsockopen($a_server,$a_port);
| 
| IF (!$sock)
| {
| echo (bCould Not Connect To Server./b);
| }
| 
| fputs($sock,$a_query\r\n);
| 
| while(!feof($sock))
| $result .= fgets($sock,128);
| 
| fclose($sock);
| 
| IF (eregi($available,$result))
| {
| echo (font color=\blue\b$a_query is available./b/font);
| echo (BR);
| echo (BR);
| echo (font class=\bod\/fontDomain Check Copyright:);
| echo (BR);
| echo (BR);
| echo (2002 WebWorkz Network, Inc. All Rights Reserved./font);
| }
| 
| ELSE
| {
| echo (font color=\red\b$a_query is not available./b/font);
| echo (BR);
| echo (BR);
| echo (font class=\bod\Domain Check Copyright:);
| echo (BR);
| echo (BR);
| echo (2002 WebWorkz Network, Inc. All Rights Reserved./font);
| }
| 
| }
| 
| The domain variable is $query and the extension I want to add is passed as
| $ext... any thoughts?
| 
| Thanks in advanced.
| 
| Cesar Aracena [EMAIL PROTECTED] escribió en el mensaje
| news:[EMAIL PROTECTED]
|  Hi all,
| 
|  Anyone knows about anyPHP script to add a domain check option to a web
| site
|  like almost any hosting company has? I'm looking into hotcripts.com but
|  everything offered serves also like a registering script for the available
|  domains and I just want to inform my visitors if the domain they entered
| is
|  available or taken... that's all.
| 
|  Thanks in advanced,
|  ___
|  Cesar L. Aracena
|  Commercial Manager / Developer
|  ICAAM Web Solutions
|  2K GROUP
|  Neuquen, Argentina
|  Tel: +54.299.4774532
|  Cel: +54.299.6356688
|  E-mail: [EMAIL PROTECTED]
| 
| 
| -- 
| 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



Re: [PHP] MySQL newsgroup

2003-12-18 Thread Website Managers.net
Yahoo has a very active group for PHP/MySQL. 
http://groups.yahoo.com/group/php_mysql/

Jim

- Original Message - 
From: Sam Masiello [EMAIL PROTECTED]
To: JLake [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, December 18, 2003 1:56 PM
Subject: RE: [PHP] MySQL newsgroup



The URL below lists all of the MySQL mailing lists.  Just choose the one
that is most specific to your issue:

http://lists.mysql.com/

HTH!

--Sam


JLake wrote:
 Can anyone point my to a MySQL specific SQL newsgroup. having some
 problem corectly extracting data. 
 
 Thanks,
 
 J

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



Re: [PHP] picking up a form name

2003-12-18 Thread Website Managers.net
Give your forms unique names.

-- form page --
form name=form1 method=post action=whatever.php
form name=form2 method=post action=whatever.php
form name=form3 method=post action=whatever.php

-- whatever.php --
if ($_POST[form1] == Submit) { do something;}
elseif ($_POST[form2] == Submit) { do something else;}
elseif ($_POST[form3] == Submit) { do something creative;}
else {
die(no form submitted);

Jim

- Original Message - 
From: php [EMAIL PROTECTED]
To: Php [EMAIL PROTECTED]
Sent: Thursday, December 18, 2003 4:19 PM
Subject: [PHP] picking up a form name


| Hi,
| 
| If I have more than one form on a page, how can I get the 
| name of the form that was sent on the recieving page 
| without using javascript?
| 
| tia,
| Craig
| 
| 
| TOP DRAW INC.
| 
| p  780.429.9993
| f  780.426.1199   
| [EMAIL PROTECTED]
| www.topdraw.com
| 
| 10210 - 111 Street,  
| Edmonton,  Alberta   
| T5K 1K9
| 
| 
| -- 
| 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



Re: [PHP] PHP and MySQL date

2003-12-15 Thread Website Managers.net
If you need to store both date and time, there are several ways to accomplish this. 
MySQL has built-in date/timestamp options, but those long strings would need to be 
converted for be human readable.

The option I use most is telling PHP what format I want to use and entering it into 
the database as a variable character (VARCHAR) field.

$Today = date((Y-m-d H:i),mktime());
 Returns: 2003-12-15 18:20

See the PHP help file for mktime() and date()

Jim
www.websitemanagers.net

- Original Message - 
From: Cesar Aracena [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 15, 2003 5:23 PM
Subject: [PHP] PHP and MySQL date


| Hi all,
| 
| I'm making a site and need some tables from wich I can extract date, time
| and/or date/time later with PHP and I neved had very clear the way the
| possible formats work with each other so my question is what is the best (or
| recommended) method to store dates and/or times in a MySQL DB for PHP to
| work later?
| 
| Thanks in advanced,
| ___
| Cesar L. Aracena
| Commercial Manager / Developer
| ICAAM Web Solutions
| 2K GROUP
| Neuquen, Argentina
| Tel: +54.299.4774532
| Cel: +54.299.6356688
| E-mail: [EMAIL PROTECTED]
| 
| -- 
|

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



Re: [PHP] PHP IDE?

2003-12-13 Thread Website Managers.net
Some of us prefer the basics. Note Tab Pro www.notetab.com
Has syntax highlighting and enough clip book libraries to do just about anything we 
want.
NetCaptor www.netcaptor.com for previewing our work.

Jim
www.websitemanagers.net

- Original Message - 
From: Jough Jeaux [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, December 13, 2003 11:06 AM
Subject: [PHP] PHP IDE?


| Was wondering what everyone's favortie IDE is for
| coding in PHP.  I've got a big PHP project in the
| works.  I'll be doing alot with it and am looking for
| ways to boost my productivity.
| 
| --Jough

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



Re: [PHP] setting word wrap

2003-12-13 Thread Website Managers.net
Paul

What you have entered there is not normal sentence structure. Since none of your 
characters have spaces between them, the browser has noplace to break into the next 
line. Try typing normal sentences including spaces and you will see that the browser 
will break at or near the right edge, depending on the size of the words. Even if you 
hyphenate a long word, the browser will have something to wrap.

Also, change tr width=100% bgcolor=#66tdtesting/td
TO
tr bgcolor=#66td width=95%testing/td

That will help define the margins.

Jim
www.websitemanagers.net

- Original Message - 
From: PAUL FERRIE [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, December 13, 2003 3:22 PM
Subject: [PHP] setting word wrap


| Hi guys i wonder if someone could help me with this.
| 
| http://thor.ancilenetworks.co.uk/~pferrie/vin/php/adm/
| If you select table reviews and the press view database u will see that
| the text goes whey out to the right of the page making the bottom scrollbar
| kickin, this is not good.  When i add a new record i have to press RETURN
| in a multi line text field for it to wrap in the data being sumbitted. I
| thought i could set the table width wich would make the text wrap, but as u
| can see this is not the case.  Can anyone give me any help with this?
| 
| cheers
| Paul
| 
| -- 
| 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



Re: [PHP] Re: PHP Math Question

2003-12-11 Thread Website Managers.net
I like Eric's idea of showing the values and added a form to it so you can 
select the number of items to show before running the script.

?php
if(!$_POST[Submit]) {
echo form method=post action=.$_SERVER[PHP_SELF].
Maximum Number to Show: input type=text name=i size=5 value=1
input type=submit name=Submit value=Show
/form;
}

else {
for($i = 1, $j = 1; $i = $_POST[i]; $i++, $j++){

 if($j == 5){
  $j = 1;
  print \nbr;
 }

 print $i. is to .$j.br\n;

} // end for

?

Jim

- Original Message - 
From: Bronislav Kluka [EMAIL PROTECTED]
To: Eric Bolikowski [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, December 11, 2003 5:22 PM
Subject: RE: [PHP] Re: PHP Math Question


| I do not know if I understand well, but what about 
| 
| $group=$number % 4;
| if ($group==0) $group=4;
| 
| Brona
| 
|  -Original Message-
|  From: Eric Bolikowski [mailto:[EMAIL PROTECTED]
|  Sent: Thursday, December 11, 2003 10:53 PM
|  To: [EMAIL PROTECTED]
|  Subject: [PHP] Re: PHP Math Question
|  
|  
|  
|  Mike D [EMAIL PROTECTED] wrote in message 
|  news:[EMAIL PROTECTED]
|   I'm am completely stumped on a seemingly simple math formula
|  
|   I need to find a way to map a set of numbers up to 4 (e.g. 
|  1,2,3,4 or 1,2)
|   to any number in a range of up to 10,000 (ideally, unlimited). 
|  Such that,
|  
|   (e.g. 1,2,3,4)
|  
|   1 is to 1
|   2 is to 2
|   3 is to 3
|   4 is to 4
|  
|   5 is to 1
|   6 is to 2
|   7 is to 3
|   8 is to 4
|  
|   9 is to 1
|   10 is to 2
|   11 is to 3
|   12 is to 4
|  
|   13 is to 1
|   14 is to 2
|   15 is to 3
|   16 is to 4
|  
|   And so on...
|  
|   Is anyone good at math, that can throw me a bone?
|  
|   Thanks y'all,
|   Mike D
|  
|  
|   
|   Mike Dunlop
|   AWN, Inc.
|   // www.awn.com
|   [ e ] [EMAIL PROTECTED]
|   [ p ] 323.606.4237
|  
|  Here is some simple code to solve that problem(if i have 
|  understood right):
|  
|  ?php
|  
|  for($i = 1, $j = 1; $i = 1; $i++, $j++){
|  
|   if($j == 5){
|$j = 1;
|print \nbr;
|   }
|  
|   print $i is to $jbr\n;
|  
|  }
|  
|  ?
|  
|  Eric
|  
|  -- 
|  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
| 
|

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