[PHP] join() , can do that fast?

2002-10-07 Thread lallous

Hello,


I have:
$x = array('str1','str2','str3');

I want to convert that array to a valid javascript syntax as:

var x = ['str1','str2','str3']

I can do this in PHP:

echo sprintf(x=[%s], join(',', $x));

but that would produce:
x = [str1, str2, str3]

is there is a fast way (other than doing a loop) to have join put quote
around each array value before joining? so final result looks like:
['str1','str2',...


Thanks,
Elias



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




Re: [PHP] join() , can do that fast?

2002-10-07 Thread lallous

John, what you said would simply produce:
   var x = ['str1,str2,str3']
and not as I want:
  var x = ['str1','str2','str3']


Elias,

John W. Holmes [EMAIL PROTECTED] wrote in message
002101c26de2$982bf7d0$7c02a8c0@coconut">news:002101c26de2$982bf7d0$7c02a8c0@coconut...


  -Original Message-
  From: lallous [mailto:[EMAIL PROTECTED]]
  Sent: Monday, October 07, 2002 6:09 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] join() , can do that fast?
 
  Hello,
 
 
  I have:
  $x = array('str1','str2','str3');
 
  I want to convert that array to a valid javascript syntax as:
 
  var x = ['str1','str2','str3']
 
  I can do this in PHP:
 
  echo sprintf(x=[%s], join(',', $x));

 echo sprintf(x=['%s'], join(',', $x));

  but that would produce:
  x = [str1, str2, str3]
 
  is there is a fast way (other than doing a loop) to have join put
 quote
  around each array value before joining? so final result looks like:
  ['str1','str2',...

 ---John Holmes...





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




Re: [PHP] join() , can do that fast?

2002-10-07 Thread lallous

Thanks John,

sorry I didn't see the new join()'s parameters you provided, I only noticed
the new '%s' .

Elias,



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




[PHP] after mysqlfront?

2002-10-04 Thread lallous

Hello

MySqlfront.de's mysqlfront program has been discontinued any equivalent
alternative?

thanks,
Elias



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




[PHP] timeout

2002-10-04 Thread lallous

Hello,


if i set set_time_limit(0) will my script still timeout and see in the
browser: Page timed out and cannot be displayed?

is there is anything I can do to prevent a script that takes an hour to
finish processing from being killed when timeout occurs?

Thanks,
Elias



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




Re: [PHP] timeout

2002-10-04 Thread lallous

so do you suggest that I send space-characters and then do a flush() ?

Thanks,
Elias

Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 If you set_tiome_limit(0) your script will not be timed out as long as it
 keeps sending something every now and then.  If it just sits there without
 outputting anything, then Apache will kill it off eventually.

 On Fri, 4 Oct 2002, lallous wrote:

  Hello,
 
 
  if i set set_time_limit(0) will my script still timeout and see in the
  browser: Page timed out and cannot be displayed?
 
  is there is anything I can do to prevent a script that takes an hour to
  finish processing from being killed when timeout occurs?
 
  Thanks,
  Elias
 
 
 
  --
  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] Unix passwd file

2002-10-04 Thread lallous

Peter, I think he's stuck with the parsing part?

you can file() the /etc/passwd file then explode() it and add the
username,passhash parts and/or more values into the mysql table.

Elias,

Peter Janett [EMAIL PROTECTED] wrote in message
026a01c26b94$7b45d0a0$55285742@peters">news:026a01c26b94$7b45d0a0$55285742@peters...
 You can just put the username and password in the MySQL database as normal
 text, then build your applications that are reading them to check the
 passwords with the UNIX Crypt function.

 In other words, just as your passwords are stored in a plain text file,
 store them in plain text in the db.  Then to confirm them, take the first
2
 characters of the crypted password, use them as the salt to crypt the
 password the user entered, and compare the results.  If that are the same,
 they entered a valid password.

 I guess I'm assuming your existing passwords are in crypt format, but the
 same process is probably possible with whatever format they are in.

 HTH,

 Peter Janett

 New Media One Web Services
 
 New Upgrades Are Now Live!!!
 Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
 Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25,
 Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43
 
 PostgreSQL coming soon!

 http://www.newmediaone.net
 [EMAIL PROTECTED]
 (303)828-9882

 - Original Message -
 From: Scott [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, October 04, 2002 4:43 AM
 Subject: [PHP] Unix passwd file


  I apologize if this is might be OT.  I have 5,000+ users in a unix
passwd
  file that I would like to move to a MySQL table to build a login system
  with php.  I could then use this table for Postfix and Radius.  I know
  about the getpwent in perl, but does anyone know if I populate a MySQL
  table with the login/password can php then use that encrypted password
to
  validate users?
 
  TIA
 
 
  --
  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] Re: Installing PHP

2002-10-04 Thread lallous

did you try www.phpbuilder.com for how to install PHP /win ?

Elias,
Dan [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I am trying to create a message board. I setup a windows 2000 server and
 installed IIS. In order to setup this messageboard i need to have PHP
 installed. I downloaded the PHP installer and tried to run it but i get a
 error message stating that there was a missing OCX component and it cant
 configure the webserver. Does any know where i can get step by step
 instructions in setting this up. The instructions that come from php.net
are
 too confusing.


 THanks

 Dan







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




[PHP] Re: Need to move all MySQL tables to another server

2002-10-04 Thread lallous

With the mysqldump utility (comes with mysql) you can backup/restore any
database.
I don't know if you can tell it to dump all databases and their tables too.

If you've got root access, you can simply copy the 'data' (i.e:
C:\mysql\data) from a server to another.

good luck,
Elias

Peter Janett [EMAIL PROTECTED] wrote in message
026d01c26b95$0bf65f70$55285742@peters">news:026d01c26b95$0bf65f70$55285742@peters...
 I'm upgrading a web server, and need to move all the MySQL data from the
old
 box to the new one.  I have approx. 50 databases, some of which have a lot
 of tables in them.

 I know I can write a script to list all the databases, then export the sql
 for each database, then each table in it, then the data, but I'm guessing
 someone else has faced this need, so there may be a PHP solution out
there.

 I'm hoping I can find an open source Perl or PHP script that I can simply
 point at the old and new server and tell it to copy all databases and data
 to the new server.

 Any ideas?

 Thanks,

 Peter Janett

 New Media One Web Services
 
 New Upgrades Are Now Live!!!
 Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
 Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25,
 Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43
 
 PostgreSQL coming soon!

 http://www.newmediaone.net
 [EMAIL PROTECTED]
 (303)828-9882





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




[PHP] Re: How to send POST info without a form?

2002-10-01 Thread lallous

try www.sloppycode.net

* © Sloppycode.net All rights reserved.
 * @title Html Source class - api for getting/posting to websites
 * @author C.Small
 * @version 1.0

or phpclasses.org

Elias,

Chris Nielsen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have a single php file that I want to do some different things (only one
 at a time, based on a conditional):

 display a form to the user for input
 submit information from (above) form to database
 list information in database (that has been INSERTed by the above)

 I want this file to be able to call itself using the following code:

 $input = $_SERVER['PHP_SELF'].?action=INPUT;
 $list = $_SERVER['PHP_SELF'].?action=LIST;
 print 'a href='.$input.'Input a new user/abr';
 print 'a href='.$list.'List all users/a';

 but I want to submit the action value as a POST rather than a GET. I then
 have conditionals around each of my modules that check $_POST['action']
for
 one of three values and only print that module if that's the action I need
 the file to perform.

 Basically I'm trying to figure out how to lump this all into one file.
 Obviously I could split it into three files that do each of the desired
 actions, but I would then also have to have a fourth file which provides a
 front end into it, which I don't want to do and is what got me started
down
 this path.

 How can I submit POST information to a php file without using an HTML
form?

 TIA.





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




[PHP] local resource variables

2002-09-26 Thread lallous

Hello,


I was wondering if i do:

function test()
{
  $result = mysql_query(SELECT * FROM bigbigtable);
}

after calling test() will  $result be freed as if calling
mysql_free_result()?


Elias



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




[PHP] Re: Example script : Employee schedule

2002-09-26 Thread lallous

look for an application called: TimeWebSheet



Elias,

Faisal Abdullah [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi people.
 Does anyone happen to know whether there is a sample script/application
out
 there which can tell me (and everyone else in the organisation) of what
 john doe
 is doing, and where  when he's doing it?

 I don't know a proper name for this type of application, therefor I
haven't
 found anything in google.
 Thanks.

 Sincerely,
 Faisal

 __




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




[PHP] Re: Finding out when a Web page has changed

2002-09-26 Thread lallous

I was about to tell you to use Last-Modified Header! ;)

Well then...try to fetch the page's size and compare with last time, if
changes then regrab the page.

Elias,
Vikram Vaswani [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi all,

 I need to write an application that accepts a list of URLs and checks them
 on a daily basis (via cron) to see if the pages have changed in the past
day.

 I need some help with this. Does anyone know the most optimal way to find
 out when a particular Web page has been modified? I am thinking about
using
 the Last-Modified: HTTP header - however, all servers do not return this
 header - any ideas on what the fallback should be?

 TIA,

 Vikram
 --
 I find your lack of faith disturbing.
 --Darth Vader



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




Re: [PHP] Re: Dependent Dropdown Boxes

2002-09-18 Thread lallous

it is all .js right,
but there are the js_products and the js_categories javascript variables
which are server-side generated. They are dumped from the database and
encode '|' seperated values.


Btw, what you are achieving is heavily JavaScript...otherwise you can it
almost all in PHP w/o javascript...which is reload the page everytime he
chooses a new category.

something like:
panel Categories   |  panel subCats

generate categories as:
select * from categories
generate subCats as:
select * from subcats where cat={selected Cat}

add an event to the categories listbox as: onchange=this.form.submit();

this will cause the form to reload and refill your subCats accordingly.


Elias

Roger Lewis [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Thanks Elias,

 I took a look at the code and there are indeed many things to learn;
 however, it's all in js.
 I'm trying to have php write the js, but I don't know enough about arrays
 and manipulating their elements.

 Roger

 -Original Message-
 From: lallous [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, September 11, 2002 2:02 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: Dependent Dropdown Boxes

 Hi,

 Try to learn many things from the test code i created below:

 http://lgwm.org/ozone/dynatable.htm

 Good luck,

 Elias





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




[PHP] Re: replacing mail()

2002-09-18 Thread lallous

There is something you can set in php.ini afaik.
search for 'sendmail' in that file.

Elias,
Liam [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 Yeah, mail() again...

 I want to disable the default mail command and replace it with my own.
 I've written a function that talks directly to my SMTP server, however,
I'd
 rather not go thru every single script on my server and change all the
 mail() functions.

 Any ideas?

 Cheers,
 Liam





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




Re: [PHP] Re: replacing mail()

2002-09-18 Thread lallous

Afaik, PHP on Unix does not use internal functions but instead it uses
Sendmail therefore you can configure it in PHP.INI to not use sendmail,

as for win32, PHP mails via direct SMTP connections...


Liam Mackenzie [EMAIL PROTECTED] wrote in message
002a01c25f00$54a01050$0b00a8c0@enigma">news:002a01c25f00$54a01050$0b00a8c0@enigma...
 I've spent over 6 months trying to get sendmail to work to my liking,
don't
 talk to me about sendmail!
 :-P

 eXtremail does the job real good  ;-)
 www.extremail.com

 Is there any way of EASILY rewriting PHP's mail() function?

 Cheers,
 Liam


 - Original Message -
 From: lallous [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, September 18, 2002 9:25 PM
 Subject: [PHP] Re: replacing mail()


 There is something you can set in php.ini afaik.
 search for 'sendmail' in that file.

 Elias,
 Liam [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]...
  Yeah, mail() again...
 
  I want to disable the default mail command and replace it with my own.
  I've written a function that talks directly to my SMTP server, however,
 I'd
  rather not go thru every single script on my server and change all the
  mail() functions.
 
  Any ideas?
 
  Cheers,
  Liam
 
 



 --
 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] can you get the name of an object from within it's own class?

2002-09-17 Thread lallous

even more...
what if I create $c1 as a global instance and then $c1 as a local instance
(inside a function) ?
won't c1.log overwrite c1.log ?

Elias

Marek Kilimajer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 It's not possible, imagine

 $firstname = new flashPash();
 $secondname = $firstname;

 Now is the log name secondname.log or firstname.log. Use new property.

 Simon McKenna wrote:

 Hi all,
 
 I'm new to the php world and have just finished building my first class,
 
 It works pretty well, but i've run into a quandary adding debug code,
 my problem is thus:
 
 Many objects get created by this class, often in the same php script,
 and the debug log is an actual file.  At the moment i'm naming the file
 after the name of the class, but what I would really like to do is name
 the log file after the name of the object instantiated from the class.
e.g.
 
 class flashPash {
 
$this-fpLog = fopen(flashPash.log,w+);
 
  function debugLog($LogMsg) {
   if (($this-debug == true)  (!empty($this-fpLog)))
fwrite($this-fpLog,$LogMsg.\n);
  }
 }
 
 $fpObject = new flashPash();
 $fpObject-debug = true;
 
 
 
 so...is there a way I can get the variable name fpObject from within
 flashPash itself?  i.e. so I can make the logfile fpObject.log instead
 of flashPash.log
 
  I realise it would be trivial to create a new property of the class to
 store the debug log filename, but i'm hoping I can avoid this?
 
 get_object_vars  get_class appear to be heading in the right
 direction...but not quite...so...any ideas?  is this actually possible?
 I kinda want to go down the hierarchical tree, instead of going up it :)
 
 thanks for any help.   php rocks!
 si
 
 
 
 
 
 




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




[PHP] Re: class Problem

2002-09-17 Thread lallous

Hi,

when you want to access class member variables prefix them with $this- ,
otherwise they will be treated as local vars.

hope that helps.

Elias


David Eggler [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I create a Instance fo the Class MenueItem in Menue. I change the value of
 one of its variables. But when i call the function within MenueItem there
 seems not to be a value:
 The intresting thing is it works with Other variables, even i cant echo
 them, they have a value

 Thanks for help

 class Menue {

 function Makechilde($somvalue) {
 echo Next_ID:  . $Parent_ID . BR; //Works
 $MI-Parent_ID = $Parent_ID;
 echo Parent_ID:  . $MI-Parent_ID . BR;//correct output
 $MI-write();

 }
 }

 class MenueItem {
 var $ID_Menue;
 var $Name;
 var $Parent_ID;
 var $Next_ID;
 var $Prev_ID;


 function Write() {
 echo Parent_ID:  . $MI-Parent_ID . BR;
 //(no output at all!)
 }

 }




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




[PHP] Re: Random numbers in a cronned script?

2002-09-13 Thread lallous

Yes, you're right about that point since the seed in most cases is computed
from system time = increasing probability of having same number @ the same
request time...
you can change the seed with the time() too (not all days are the same).

hope to hear others' opinions too.

Elias

Leif K-Brooks [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm wondering if random numbers in a cronned script would be anywhere
 near random (I know that rand() isn't true random, but I don't want
 every number to be the same...)?  Since the number is seeded from
 time... and cron runs by time...




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




[PHP] Re: Read/Write Pieces of a Binary File

2002-09-13 Thread lallous

what have you already tried?
can you show some code?


Elias

Bob Bowker [EMAIL PROTECTED] wrote in message
5.1.0.14.2.20020912091817.01ef3c50@localhost">news:5.1.0.14.2.20020912091817.01ef3c50@localhost...
 I have a large binary file (50+ megs) ... I want to read the first 1k
 bytes, make changes, and write a new file with the new 1k bytes plus the
 balance of the original file unchanged.

 I've tried several different ways of doing this, but nothing works, and
I'm
 out of ideas - any suggestions as to the sequence I should be following?

 Thanks --

 Bob.




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




[PHP] Re: what is wrong?

2002-09-12 Thread lallous

try this:
if (empty(trim($_POST[new_password1])))
{
  echo 'Empty!!!';
}

Meltem Demirkus [EMAIL PROTECTED] wrote in message
001701c25a2c$4758d4a0$5583@hiborya">news:001701c25a2c$4758d4a0$5583@hiborya...
 Hi,
 I want to understand what is wrong with this code?I am trying to
understand
 when an empty inputs come from form and I will then give a warning
message..

 if($_POST[new_password1] ==)

 echo empty input;



 thanks..

 meltem




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




[PHP] Re: Cry for help

2002-09-12 Thread lallous

Hello Chad,

I started PHP from a book.
I believe a book is a good way to start as it organized and well written to
make sure you're progressing chapter by chapter.
After that, I read articles and tutorials as I needed to expand my skills.

just my 2cents,
Elias


Chad Winger [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I need to learn PHP and databases. If I had those skills, I would be so
much
 more succesful with my web designs. What I usually do, is make the html
 templates, and then hire someone, usually expensively, to do the PHP and
 MySQL bankend.

 Unfortunately, my programming skill is ZERO. Ok, maybe not zero, I do have
a
 little bit of PERL experience, but it mainly comes in the form of
 downloading prewritten scripts, and lots of trial and error in editing
them
 using common sense and drawing on my experience of BASIC which I learned
 when I was 6 years old!

 I have browsed hours on the net looking for help in this sort of thing. I
 have downloaded programs, I have read hours of documents and manuals,
and
 still, I am no further along than where I started. Programming and
databases
 are more of a mystery to me than women are. I'm absolutely CLUELESS.

 So basically, I need to learn this stuff as soon as humanly possible, but
I
 have NO IDEA where to start. Let me tell you first what I have done
thusfar.

 First thing I did was download something called mySQL Max version 3.23.49
 directly from the website of mysql. I was under the impression that this
 program would be something along the lines of MS Access in the standpoint
of
 user interface, and it would allow you to create tables etc. (I do know
how
 to create some rudimentary tables in MS Access). So after I installed this
 program, I clicked on the icon to start it, and to my surprise, the only
 thing that happened was the an MS-Dos box popped up for about 2/10ths of a
 second and then disappeared. So to me it was a waste of 2 hours of
 downloading.

 After a bit more of prodding I saw that there was some configuring to do.
 For the life of me, I have no idea where to look, and even if I did, I
 wouldnt have any idea what I need to configure anyways. Basically I want
to
 have this installed so that during my learning process of PHP, I can test
 and run things on my local machine, and not have to connect to the
internet,
 upload files etc.


 Secondly, I downloaded something similar, called Easy PHP. The website
said
 it would install this and that and then something else that would allow
you
 to run PHP scripts on your local machine as well as being an editor to
help
 you write scripts. So I downloaded this as well. So 27 MB and 3 hours
later
 I have yet another useless program with no interfaces nothing. Just
 something that runs in the background.

 So now I talked with my roommate and explained these issues to him. He
 pointed me to a software called CodeCharge. So I downloaded that and spent
 hours looking through the templates and what not, and although I can see
 this is a step in the right direction, it still leaves me with more
 questions than answers. It wants me to specify DNS or ODBC or ASPI etc etc
 and I have no clue what that is, what it means or what is does.

 Furthermore I see no way to use existing html files that I have created as
 templates. Just existing ugly templates that come with the software. I'm
 sure there is a way to do that, but I haven't figured it out.

 So what are my questions? Basically want to do is create sets of HTML
 templates for various sections of sites. Then using the templates, code
the
 PHP to pull the correct information from a database, manipulate it, and
then
 return it together with templates. For example. On this a site that I am
now
 working on, there is a section that will contain headlines to various news
 stories. In the HTML it looks something like this:


 A HREF=1.htmHEADLINE/ABR
 DATE

 All this would simply create is something that looks like this Below:

 Headline
 September 12, 2002

 Obviously clicking the headline would take you to another page that would
 give you the entire story. To me, drawing on common sense, what you are
 really saying is this:


 A HREF=1.htm{LOOK IN THE DATABASE FOR A HEADLINE AND PRINT IT
 HERE}/ABR
 {LOOK IN THE DATABASE FOR THE DATE OF THE ABOVE HEADLINE AND PRINT IT
HERE}

 Makes sense no? So really for this template, it would use 2 sections from
 the database: Headline and Date and the PHP tells the server where to
 put what depending on which templates is being used

 I don't want to drag this on, but in other words for these sites that I am
 creating there are basically 1 thing that I need to accomplish.

 #1 is that I need a control panel that is somewhere that I can go to any
 computer and log in to. When I do that I can log-in and that will bring me
 to and ADD/EDIT/DELETE form for any section of the site, and if I go to
add,
 then I will type the various bits of info into it, click submit and
 

[PHP] Re: curl_init() ??

2002-09-12 Thread lallous

Hello,

1)probably you don't have CURL extension enabled in your php.ini file? try
to open php.ini and search for CURL.
2)to achieve a POST via PHP code, look at www.phpclasses.org

Elias,

Geoff Lists [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,
 I am using PHP v.4.1.2,  CURL v7.7.2   with Apache server on MacOS X
 10.1.5
 I have a PHP script containing the following:
 $ch = curl_init();
 curl_setopt($ch, CURLOPT_URL,http://omitted.com;);
 curl_setopt($ch, CURLOPT_FAILONERROR, 1);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
 curl_setopt($ch, CURLOPT_POST, 1);
 curl_setopt($ch, CURLOPT_POSTFIELDS, salexml=$saleXML);
 $result=curl_exec ($ch);
 curl_close ($ch);

 When I run the script I receive the following error:
 Fatal error: Call to undefined function: curl_init()

 My reading of the PHP manual, Curl man pages, curl web site and PHP
 books and articles in the curl-php mailing list indicate that this
 should work.

 Can someone tell me how to get PHP to recognise the function
 curl_init() or tell me another method of getting a PHP script to
 simulate POST method as though the data was being sent from a form.

 TIA
 --
 Geoff Hill
 Information Technology Training  Solutions
 A.B.N. 28 712 665 728




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




[PHP] Re: what is wrong?

2002-09-12 Thread lallous

I'ld also add isset() to avoid warnings too:

if (isset($_POST['new_password1']) 
!empty(trim(isset($_POST['new_password1']
{
  echo i am not empty, you can do whatever;
}
else
{
  echo i am empty! show error message;
}

Erwin [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Meltem Demirkus wrote:
  Hi,
  I want to understand what is wrong with this code?I am trying to
  understand when an empty inputs come from form and I will then give a
  warning message..
 
  if($_POST[new_password1] ==)
 
  echo empty input;

 And as final addition, you probably have to use

 $_POST[new_password1]

 Besides that, I would use the form of Lallous:

 if ( empty( trim( $_POST[ new_password1 ] )
 echo Empty!;

 HTH
 Erwin




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




[PHP] Re: Dependent Dropdown Boxes

2002-09-11 Thread lallous

Hi,

Try to learn many things from the test code i created below:

http://lgwm.org/ozone/dynatable.htm

Good luck,

Elias

Roger Lewis [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 The Situation:

 I'm trying to create a pair of dynamic dropdown boxes where the options in
 the second box are dependent on the selection in the first box.  I call
the
 first box categories and the second, subcategories.  I want to store
the
 categories and subcategories in a mysql table(s) so that a user can
 dynamically update them.  Currently, I have a single table called
 categories, with columns: id, category, and subcategory.

 The primary code for selecting the options for the second box is in
 javascript.  This code makes use of the following datasets for storing the
 various categories and subcategories.  If I can get php to generate this
 text, then the dependent boxes will work.

 datasets=new Array();

datasets[0]=Category1,subCategory1_1,subCategory1_2,subCategory1_3,subCateg
 ory1_4.split(,);

datasets[1]=Category2,subCategory2_1,subCategory2_2,subCategory2_3.split(
 ,);
 datasets[2]=Category3,subCategory3_1, subCategory3_2,
 subCategory3_3,subCategory3_4,subCategory3_5.split(,);

datasets[3]=Category4,subCategory4_1,subCategory4_2,subCategory4_3,subCateg
 ory4_4.split(,);

datasets[4]=Category5,subCategory5_1,subCategory5_2,subCategory5_3,subCateg
 ory5_4,subCategory5_5,subCategory5_6.split(,);
 etc.

 The Problem:

 Using the following code I can get php to print the results, but only in a
 line-by-line, category/subcategory format.  Of course, this is NOT what is
 needed.  Each subcategory name should be on the same line as its
associated
 category.

 ?php
 $dbConnect = mysql_connect(localhost, root, pwd);
 mysql_select_db(new_kb,$dbConnect);
 $sql = SELECT * from categories;
 $result = mysql_query($sql);
 for ($count = 1; $row = mysql_fetch_row ($result); ++$count)
 {
 print brdatasets[$count]=\;
 print $row[1],;
 print $row[2]\;
 }
 ?


 datasets[0]=Category1,subCategory1_1
 datasets[1]=Category1,subCategory1_2
 datasets[2]=Category1,subCategory1_3
 datasets[3]=Category1,subCategory1_4
 datasets[4]=Category2,subCategory2_1
 datasets[5]=Category2,subCategory2_2
 etc.

 Can someone explain how to write the php code to output the category and
 subcategory names from the mysql table to match the javascript format
above.

 Thanks in advance for any help or suggestions.

 Roger Lewis






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




[PHP] Re: Help, Parse error caused by quotes andapostrophes in function, How do I fix this?

2002-09-11 Thread lallous

try this:

exec('convert picture.jpg  -font Arial-Bold -pointsize 20 -fill red -gravity
southeast -draw text 10,10 \'my text to add to picture\'
text-overlay.jpg');

when you start with a single quote - you have to end with a single quote
while escaping (using \) all its occurences in the used string.

Elias,

Kurtis Harper [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 The following is the format needed in order to run the convert command
from
 command line, but I have a problem in exec() format:



 convert picture.jpg  -font Arial-Bold -pointsize 20 -fill red -gravity
 southeast -draw text 10,10 'my text to add to picture' text-overlay.jpg




 this causes problems Parse error: parse error, unexpected T_STRING:



 exec('convert picture.jpg  -font Arial-Bold -pointsize 20 -fill
red -gravity
 southeast -draw text 10,10 'my text to add to picture'
text-overlay.jpg');



 I am positive the it is due to all the s and 's within the command, I
have
 tried the specialchars for quotes andapostrophes but I am still missing
 something:



 exec('convert picture.jpg  -font Arial-Bold -pointsize 20 -fill
red -gravity
 southeast -draw quottext 10,10 \'my text to add to picture\'quot
 text-overlay.jpg');



 If anyone has any ides on how to avoid probles with quotes andapostrophes
 inside the exec() I am all ears :o)





 Thanks




 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.386 / Virus Database: 218 - Release Date: 9/9/2002





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




[PHP] Re: sessions nightmare

2002-09-11 Thread lallous

I use JavaScript cookie to accomplish what you're doing in your case:

script
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + = + escape(value) +
  ((expires) ? ; expires= + expires.toGMTString() : ) +
  ((path) ? ; path= + path : ) +
  ((domain) ? ; domain= + domain : ) +
  ((secure) ? ; secure : );
  document.cookie = curCookie;
}

function nav(value)
{
  setCookie('searcheditem', value);
  location.replace('after-search-click.php');
}
/script

now in my search result display i do:
a
href=javascript:nav('?=$search_result['itemid']?')?=$search_result['la
bel']?/a
.
.
then in whatever page I want the search result item, i access it as:
$searchitem (as named in setCookie() call)


good luck,
Elias


Chris [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Greetings,

 I am a new user to php and sessions and for the life of me I
 cannot figure this out

 I want to be able to have a user login (which is completed), they goto a
 search page (completed), and search for a particular item (completed). A
 page will display all the links for the items searched for (completed).
 What I want out of sessions is to when they click on the link for a
 particular item, the item number stay in a session so it can be called
 through out each page they goto. What I have as a base of test code is the
 following (this was taken from someone's example):

 test1.php:

 ?php
 session_start(  );
 session_register(SESSION);

 *** THE FOLLOWING VARIABLE ($retrived_itemno) WOULD NEED TO BE SET ON THE
 *** SEARCH PAGE ***
 $SESSION[item] = $retrived_itemno;

 $test2Url = test2.php?PHPSESSID= . session_id(  );

 ?

 a href=?=$test2Url ?Goto next page/a


 test2.php:

 ?php
 session_start( );
 echo the retrived value equals: $SESSION[item];
 ?



 After you click the hyperlink on test1.php, test2.php will load and the
 session ID is in the URL, but nothing is displayed in the echo for
 $SESSION[item] in test2.php. What is going on?!#!#!$#


 Thanks a million in advance!!
 - Chris





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




[PHP] Re: Generating CSV files on the fly and getting the browser to download

2002-09-10 Thread lallous

Try this:

?php
$fileextension=csv;
$filename=report;
$fnsave = $filename.$fileextension;

header(Content-disposition: filename=$fnsave);
header(Content-type: application/force-download);

// generate your CSV content here and print them to the browser via ECHO
echo 'a,b,c,d,1';
//.

?

Elias

Henry [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi All,

 I suspect this is a commonly asked question but; how do I generate a CSV
 files on the fly and get the browser to download it.

 Do I actually need to generate a file or can I just generate a variable
 contain the data that would be in the file?

 Any help is greatly appreciated.

 TIA

 Henry





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




Re: [PHP] gmdate()

2002-09-07 Thread lallous

I got an idea to solve my problem.

I'll make client side calculation.
I'll set the user pick a future time and then calculate from the client side
how many minutes exists between these two times, then pass the minutes
difference to the server.

Naintara Jain [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 lets say,

 ServerOne has TimeZone GMT+2
 ServerTwo has TimeZone GMT+3

 the gmdate() will return diff values for the same timestamp.
 essentially there will be a diff of 1 hour in the return values from these
 two servers.

 -Naintara

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]
 t]On Behalf Of lallous
 Sent: Friday, September 06, 2002 8:55 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] gmdate()


 I don't own the server, and the server is probably set up correctly as it
is
 a web hosting server.

 anyway, how should that RedHat 6 server be set up ?

 Elias
 Marek Kilimajer [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  The server needs to be set up correctly - it needs to know what time
  zone it is in and if the BIOS time is GMT or local.
 
  lallous wrote:
 
  Isn't the gmdate() supposed to return the same value when run from two
  different timezones?
  
  
  I run it on GMT+2 system and EDT system, and I get 1 hour difference,
  
  please advise.
  
  Elias
  
  
  
  
  
 



 --
 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] Re: Array Javascript

2002-09-06 Thread lallous

if you have an array in javascript:

array1 = [1,2,3,4,5,6,7,8,'test'];
etc...

you can join it in JavaScript to make it a one string as:
array1 = array1.join('|');

then split in PHP to make it back an array:
?
$array1 = explode('|', $array1);
?

good luck,


Kale [EMAIL PROTECTED] wrote in message
002c01c254cc$fe8eace0$7800a8c0@leonard">news:002c01c254cc$fe8eace0$7800a8c0@leonard...
 Hy,
 I have an array make with a javascript.
 How can I read values with PHP from it?
 Kale.




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




[PHP] Re: Source code

2002-09-06 Thread lallous

showsource.php:
html
body
span style='border:dashed 2px red'
?
$mem = join('', file('THEFILE.HTM'));

$mem = htmlspecialchars($mem);
echo $mem;
?
/span

Good luck,

Roman Duriancik [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 How I show in IE source code of html page with php ?


 roman




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




Re: [PHP] Source code

2002-09-06 Thread lallous

I think it is also good to fetch $mem as:

$fp = fopen('index.htm', 'r');
$mem = fread($fp, filesize('index.htm'));
fclose($fp);

that will keep index.htm formatted as is.

Adrian Murphy [EMAIL PROTECTED] wrote in message
001b01c2559f$aa8f3c30$1a8f43d9@ADE2">news:001b01c2559f$aa8f3c30$1a8f43d9@ADE2...
 add nl2br() to make it look pretty e.g

 span
 ?
 $mem = join('', file('index.htm'));

 $mem = htmlspecialchars($mem);
 $mem = nl2br($mem);
 echo $mem;
 ?
 /span
 - Original Message -
 From: Roman Duriancik [EMAIL PROTECTED]
 To: PHP-General [EMAIL PROTECTED]
 Sent: Friday, September 06, 2002 11:53 AM
 Subject: [PHP] Source code


  How I show in IE source code of html page with php ?
 
 
  roman
 
 
  --
  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] Re: about whitespace

2002-09-06 Thread lallous

str_replace()

Meltem Demirkus [EMAIL PROTECTED] wrote in message
001201c255a4$6253ece0$5583@hiborya">news:001201c255a4$6253ece0$5583@hiborya...


 Hi,

 is there any function which removes white spaces inse a string?

 thanks







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




[PHP] gmdate()

2002-09-06 Thread lallous

Isn't the gmdate() supposed to return the same value when run from two
different timezones?


I run it on GMT+2 system and EDT system, and I get 1 hour difference,

please advise.

Elias



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




[PHP] Re: Html in a string

2002-09-06 Thread lallous

$mem = '
 !-- start
 HTML CODES HERE
 HTML CODES HERE
 HTML CODES HERE
 HTML CODES HERE
 HTML CODES HERE
 HTML CODES HERE
 HTML CODES HERE
 // end --
';
if (preg_match('/!--.+?--/is', $mem, $result))
{
  var_dump($result);
}

good luck,


Bård tommy nilsen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...


 Hello


 I have a string with the html source, but want to fetch only some
 Of the code ...

 I want to use alle the codes inside start-end ..

 Example:


 !-- start
 HTML CODES HERE
 HTML CODES HERE
 HTML CODES HERE
 HTML CODES HERE
 HTML CODES HERE
 HTML CODES HERE
 HTML CODES HERE
 // end --



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




Re: [PHP] gmdate()

2002-09-06 Thread lallous

I don't own the server, and the server is probably set up correctly as it is
a web hosting server.

anyway, how should that RedHat 6 server be set up ?

Elias
Marek Kilimajer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 The server needs to be set up correctly - it needs to know what time
 zone it is in and if the BIOS time is GMT or local.

 lallous wrote:

 Isn't the gmdate() supposed to return the same value when run from two
 different timezones?
 
 
 I run it on GMT+2 system and EDT system, and I get 1 hour difference,
 
 please advise.
 
 Elias
 
 
 
 
 




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




[PHP] Re: Javascript ?

2002-09-05 Thread lallous

try

www.ozoneasylum.com


Elias

Christopher J. Crane [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Does anyone know of a Javascript forum like this one that I can post a
 question to?





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




[PHP] Re: Pass array in HTTP_POST_VARS question

2002-09-04 Thread lallous

you can also join() the elements and pass as a single string, then explode()
the elements back again.

Elias
Paul Maine [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Is it possible to pass an array in a form post? If so, how do I reference
 the array on the next page?

 Thank You
 Paul
 php




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




[PHP] Re: script mysql date picker

2002-09-04 Thread lallous

This script is not mine, but I modified it so that it can work with any form
field...
take a look at the sources:

http://lgwm.org/ozone/calcall.htm

Good luck.

Adi [EMAIL PROTECTED] wrote in message
001701c253f3$5ce58820$9600a8c0@adi">news:001701c253f3$5ce58820$9600a8c0@adi...
Hi,
There are somewhere a script to manage mysql table in this way:
-In table i have a date field(format -mm-dd). I tried webmin,
PHPMyEdit etc, for editing this field from web page, but field is displayed
as textbox and i have to write manually date field. I want next to textfield
a button with popup window with calendar inside, when i select a day, popup
window is closed and value selected is written in textbox.
In html with javascript is easy, but here i mess.
tx in adv for any help





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




[PHP] Re: Remote file download and https

2002-09-04 Thread lallous

Do you have SSL library installed? check that PHPINFO() i guess.

You can also try to run curl() (if they have SSL support).


Otherwise, It will be hard to implement SSL from pure PHP sockets functions.

Elias

Radu Manole [EMAIL PROTECTED] wrote in message
001401c25404$a52baae0$[EMAIL PROTECTED]">news:001401c25404$a52baae0$[EMAIL PROTECTED]...
 Hi Guys,

 I'm trying to create a transparent download using a script (the script
 would run from my local machine) that will request a file from a remote
 server, that looks like this (https request):

https://www.httpsserver.net/Pages/Download.asp?usr=testpass=testfrom=05/01
 /02to=09/03/02
 This link will trigger an excel file download.

 I tryed with fsockopen() and fopen() but no luck.
 Also the Header (Location: $myurl) starts the download but redirect the
 user to httpsserver.
 Any ideas and hints to start this transparent download would be much
 appreciated. Maybe to use a popup window?

 Many Thanks,
 Radu





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




[PHP] Re: Carriage Returns in Text Fields

2002-09-03 Thread lallous

How and where are you spitting out the text?

If to HTML output, the use the nl2br(). or spit between pre tags.

Elias
Royw [EMAIL PROTECTED] wrote in message
00a301c25336$9815cc60$[EMAIL PROTECTED]">news:00a301c25336$9815cc60$[EMAIL PROTECTED]...
 I have a script which takes a memo field and stuffs it into a mediumtext
 column of a MySQL table.

 When I spit out the contents of the field, the carriage returns are no
 longer there... how do I maintain the integrity of the paragraphs in text
 fields?

 Thanks






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




[PHP] Re: why is html code written like this? hr /

2002-09-02 Thread lallous

hr tag does not need a closing tag, therefore you don't write /hr.

Now TAG NAME / tags are used to make the document compatible with XHTML,
XML ...

Victor [EMAIL PROTECTED] wrote in message
01c25272$357e6360$a3a96518@jumpy">news:01c25272$357e6360$a3a96518@jumpy...
 When I learned html it was always written like this: /hr now I see
 people write it like this: hr /... why?

 - Victor  www.argilent.com


 __
 Post your free ad now! http://personals.yahoo.ca



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




[PHP] Re: how do I send information to a php page from a menu list

2002-09-02 Thread lallous

Hello Ivan,

   select name=selcategoryid value=0

Don't set a value for that tag!

  echo option name=\selcategoryid\
value=\$faqcatsid\$faqcats/option;
no need to name the option tag too, setting the value will be enough.


when you submit your form,  faqbycat.php will receive $selcategoryid as the
user chose from that select list.

Elias,

Ivan Carey [EMAIL PROTECTED] wrote in message
005801c2527c$dcb00260$0201a8c0@ivan">news:005801c2527c$dcb00260$0201a8c0@ivan...
Hello,
how do I send information to a php page from a menu list?

When a user selects an item from the list I would like to be able to send
selcategoryid to faqbycat.php without the use of a submit button.

Is it done by using the onChange event? if so how may this be done?

The code I am using presently is below

form action=faqbycat.php
 select name=selcategoryid value=0
  option name=selcategoryid value=0 selectedSelect a
Category/option
   ?php
   //display list of provider names
while ($myrowcating=MySQL_fetch_array($resultcatdet))
 {
  $faqcatsid=stripslashes($myrowcating[breastfaqcatid]);
  $faqcats=stripslashes($myrowcating[breastfaqcat]);
  echo option name=\selcategoryid\
value=\$faqcatsid\$faqcats/option;
 }//while ($myrowadmintitles=MySQL_fetch_array($admintilteresult))
   ?
 /select
 brbr
 input type=Submit name=selbycat value=Show FAQ's by Category
/form

Thanks for your answer,
Ivan




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




[PHP] Re: changing the include path

2002-08-30 Thread lallous

refer to:
string ini_set ( string varname, string newvalue)

Henry [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello All,

 Is it possible to change the include path when a script is runing without
 having to change the php.ini file?

 TIA

 Henry






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




[PHP] Re: cURL and POST

2002-08-21 Thread lallous

even more, if you want to use curl...
I remember that curl can take post data from an input file, so dump the
$strXML to a temp file then supply that file to curl.

good luck,

Samantha Savvakis [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 HI,

 I'm using the cURL binary to perform a HTTP POST to a web page. I am
sending
 XML data to this web page.

 The issue I've come up against if the size of the data that I'm trying to
 post and it looks like cURL is crapping out.

 This is the command line that I'm currently using:

 /usr/local/bin/curl -m 600 -d $strXML http://myurl.com/webpage.php -L -s

 $strXML - variable containing the XML data. I run this command using
exec.

 The return code I receive is: 127. This means a fatal error has occured
with
 cURL but that's all I know.

 I have read the detail about using the -F option. I do not want to POST
the
 file as such, but rather the DATA in the file is I create a file of
the
 XML. The manpage for cURL states:

 -F : To just get  the content part from a file, prefix the file name with
 the letter . The difference between @ and  is then that @ makes a file
get
 attached in the post as a file upload, while the  makes a text field and
 just  get  the contents for that text field from a file.

 So I've tried going:

 /usr/local/bin/curl -m 600 -F /tmp/tempfile.xml
 http://myurl.com/webpage.php -L -s

 /tmp/tempfile.xml - contains the XML data. This isn't working.I'm getting
a
 return code of 2 meaning: Failed to initialize.

 I'm at a loss. I need to post this large amount of XML data to a remote
site
 and don't know how to get it there.

 Any ideas?

 Thanks,
 Sam








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




[PHP] Re: cURL and POST

2002-08-20 Thread lallous

Try to post it via other than CURL,

http://Sloppycode.net  and search for clsHtmlSource.php

Good luck,
Elias
Samantha Savvakis [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 HI,

 I'm using the cURL binary to perform a HTTP POST to a web page. I am
sending
 XML data to this web page.

 The issue I've come up against if the size of the data that I'm trying to
 post and it looks like cURL is crapping out.

 This is the command line that I'm currently using:

 /usr/local/bin/curl -m 600 -d $strXML http://myurl.com/webpage.php -L -s

 $strXML - variable containing the XML data. I run this command using
exec.

 The return code I receive is: 127. This means a fatal error has occured
with
 cURL but that's all I know.

 I have read the detail about using the -F option. I do not want to POST
the
 file as such, but rather the DATA in the file is I create a file of
the
 XML. The manpage for cURL states:

 -F : To just get  the content part from a file, prefix the file name with
 the letter . The difference between @ and  is then that @ makes a file
get
 attached in the post as a file upload, while the  makes a text field and
 just  get  the contents for that text field from a file.

 So I've tried going:

 /usr/local/bin/curl -m 600 -F /tmp/tempfile.xml
 http://myurl.com/webpage.php -L -s

 /tmp/tempfile.xml - contains the XML data. This isn't working.I'm getting
a
 return code of 2 meaning: Failed to initialize.

 I'm at a loss. I need to post this large amount of XML data to a remote
site
 and don't know how to get it there.

 Any ideas?

 Thanks,
 Sam








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




[PHP] Re: Replicate string or something similar

2002-08-20 Thread lallous

$str = str_pad('', 254, 'A');

Saci [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 In ASP I use the expression myvar = string(254,A)

 to have a var filled with 254 characters 'A'

 What is the similar one in PHP?






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




[PHP] Re: ICQ interface?

2002-08-19 Thread lallous

I feel like the request being sent is erroneous.

it was:
fputs($fp,GET/scripts/online.dll?icq=$uinimg=5HTTP/1.0\n\n);

It should be:
fputs($fp,GET /scripts/online.dll?icq=$uinimg=5 HTTP/1.0\n\n);


And beside that it seems it is an outdated URL


Elias

Justin French [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Has anyone built, or partially built an interface to ICQ?

I'm not necessarily looking for full IM thru a web/PHP interface, but maybe
some small stuff, like finding out if a certain user is online?

I did a google and found this on Zend.com, but can't get it working (it
returns unknown everytime, with any number):

?
function get_status($uin)
{
/*
* Copyright © 2000 Scriptmakers.com *
* Feel free to edit, modify and*
* redistribute as long as this*
* message is kept intact.*
*/

$fp = fsockopen(wwp.icq.com, 80, $errno, $errstr, 30);
if(!$fp)
{

echo $errstr($errno)br\n;
}
else
{
fputs($fp,GET/scripts/online.dll?icq=$uinimg=5HTTP/1.0\n\n);
$do='no';
while(!feof($fp))
{
$line=fgets($fp,128);
$do=($do=='yes')?'yes':(eregi(^GIF89,$line))?'yes':'no';;
if($do=='yes')
{
if(ereg(á7@ ±40,$line))
{
return 'online';
}
elseif(ereg(áw` ±40,$line))
{
return 'offline';
}
elseif(ereg(S3IѱèJ,$line))
{
return 'disabled';
}
}
}
fclose($fp);
}
return 'unknown';
}

/*  usage --
include('icq_status.php');
$uin=51362125;
echoget_status($uin);
*/
?


... and this, which spits out an error:
Warning: file(http://wwp.icq.com/scripts/online.dll?icq=img=1;) -
Undefined error: 0 in /usr/local/apache/htdocs/hinge/viewmember.php on line
13

?

$uin = 51362125;
function ICQ_Status($uin)
{
 $arr = file(http://wwp.icq.com/scripts/online.dll?icq=$uinimg=1;);
 $len = strlen($arr[1]);
 if ($len == ) return ICQ: span style=\color:#707070\Local
Server/span;
 if ($len == 96) return ICQ: span style=\color:#009000\Online/span;
 if ($len == 83) return ICQ: span style=\color:#b0\Offline/span;
 if ($len == 1) return ICQ: span style=\color:#80\Disabled/span;
}
echo ICQ_Status($uin);

?


My guess is that these both DID work at one point, but if ICQ keeps changing
their methods, then the scripts become redundant.


Any links / guidance would be great!


Justin French




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




Re: [PHP] Continue processing after redirect?

2002-08-17 Thread lallous

Hello Rasmus,

Now that the topic has been brought,

How much long will the script keep running after the redirection request has
been made?

Doesn't that behaviour depend from browser to browser ?


Thanks,


Elias

Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Sure, in fact, that happens by default unless you explicitly exit or try
 to output something.

 On Sat, 17 Aug 2002, Jason Morehouse wrote:

  Any ideas if it's possible to keep a script running for a short time
after a
  client has been redireced?
 
  i.e:
  ?
  header(Location: http://php.net;);
  # contunue running...
  mail([EMAIL PROTECTED], Hey, Hi!);
  ?
 
  Using Redhat Linux, Apache  PHP 4.2.2.
 
  Much thanks!
  -Jason
 
 
 
  --
  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] Re: i some more help on the whole ereg thingy please

2002-08-16 Thread lallous

preg_match('!div class=Section1[^]+(.*)/div!Uis',$str,$regs[1]);
$everything_between_divs = $regs[1];

when calling preg_match just pass $regs as param and not $regs[1]

Elias

[EMAIL PROTECTED] wrote in message
000101c244c9$08401d50$86a96518@jumpy">news:000101c244c9$08401d50$86a96518@jumpy...
 Hi, I hope you can help me a bit more, this is is my current script:
 (look after for more messages)

 ?php
 $file_name = $page_name.$ext
 or die ('Error 2');

 $file = file($path.$file_name)
 or die ('Error 3');

 $str = implode(' ', $file)
 or die ('Error 4');

 // This is to check if the above code works
 // echo $str;
 // End check

 // Original first tag from the document I need to parse
 // div class=Section1
 // Original last tag
 // /div

 preg_match('!div class=Section1[^]+(.*)/div!Uis',$str,$regs[1]);
 $everything_between_divs = $regs[1];

 //echo $everything_between_divs;

 $good = implode(' ', $regs)
 or die ('Error 5');

 // This is for later use to edit the contents of stuff between
 // the div tags - if I get the div tags to ever work
 $clean = ereg_replace(o:p/o:p,   , $good);
 echo $clean;
 ?

 it doesn't work, what do you think I'm doing wrong?

 I get this error:

 Notice: Undefined offset: 1 in
 /home/victor/argilent-www/sites/malibu_place_2/index.php on line 104

 Warning: Bad arguments to implode() in
 /home/victor/argilent-www/sites/malibu_place_2/index.php on line 106
 Error 5

 Thanks,

 - Vic



 __
 Post your ad for free now! http://personals.yahoo.ca



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




[PHP] Re: Getting PHP to submit a form to google

2002-08-16 Thread lallous

by simple ways, you can do that:

$query = urlencode(your query string)
$result_string = join('', file(http://www.google.com/search?q=$query));


Elias

Henry [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi all

 I would like to be able to get the result of a search from google. Namely
I
 would like to write a PHP script that will generate and submit a form
 (internally i.e. on the server) using the GET method to
 http://www.google.com/search setting the field q to the search words. It
 should then parse the results so that I can feed them back to the user in
a
 form that I choose.

 How should/can I go about this?

 TIA.

 Henry.





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




[PHP] Re: How retrieve database data from email?

2002-08-16 Thread lallous

How and where can I add an alias and associate PHP with that alias?


Elias
Bogdan Stancescu [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 You can set up php to run from console if it doesn't already, and add an
 alias to your mail server (stocks) which would parse the incoming mail
 and do the appropriate deeds.

 Bogdan

 M wrote:
  Hello People:
 
  I have my pages built in PHP / Mysql, all working ok, but now I need
  solve a problem I don't know how to solve or even how search about. Case
  this problem was already discussed in this list, I would be grateful if
  someone pass to me correct date so I can search about.
 
  My problem is very simple: I have customers who dont want enter into
  html pages to retrieve some info (suppose info are stock values), but
  rather they want to send email with formatted query into mail subject
  (or at least in body) , and then receive response again by email.
 
  For instance, customer could send this for [EMAIL PROTECTED]
 
  to: [EMAIL PROTECTED]
  subject: name=ibm, year=2001
  body: (empty)
 
  In response, he should receive an email with all IBM stock prices day by
  day.
 
  That't all, I hope this will have solution, but I can't figure how email
  could communicate automatically with PHP/Mysql.
 
  Thanks
 
  Miguel
 
 





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




[PHP] Re: How do I customize the User-Agent when opening a remote file?

2002-08-16 Thread lallous

one of the solutions is not using fopen() instead use another class that is
able to post to pages and retrieve them.

check phpclasses.org


Dallas Thunder [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 How do I customize the User-Agent when using fopen() or file() to open a
 remote file?

 PHP use PHP/4.2.3-dev on my system as the User-Agent when I using file()
 function to retrive a remote file.  Howerver, some servers will refuse to
 serve browsers other than Mozilla compatible and return a 403 code.  Is
 there any method to let me define User-Agent for my own?  Thanks!









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




Re: [PHP] help with making appropriate indexes.

2002-08-16 Thread lallous

Thanks Miles.

But i'm not satisfied with your answer. I instinctly created indexes on
every field that I'm using w/ conditions.
But I feel that my script can be rewritten more efficiently using JOINTs or
other things.

Any site with reading material regarding how to index and make complex
queries fast?


I use the 'table_' just to hide the original table names prefixes.


Elias

Miles Thompson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 General rule of thumb - create indexes on any fields which will be used in
 the conditional part of a select statement, whether where or join. Since
 you are working with tables, you can save yourself a lot of typing by
 dropping the table_ from the table names. After all, that's what they
 are. (You can do this unless you've gone too far with your system.)

 Miles Thompson

 At 02:15 PM 8/14/2002 +0200, lallous wrote:
 give this query:
 
SELECT
  table_routing.id  AS   routeid,
  table_pricing.units   AS   price,
  table_routing.providerAS   providerid,
  table_country.nameAS   countryname,
  table_country.id  AS   countrycode
FROM
  table_pricing,
  table_routing,
  table_country
WHERE
  table_country.id = table_routing.country
 AND
  table_routing.country = table_pricing.country
 AND
  table_routing.provider = table_pricing.provider
 AND
  table_country.enabled = 1
ORDER BY routeid
 
 what keys / indexes should I create on whatever tables to make this query
 efficient?
 I don't know if this query can be re-written even with JOINs and stuff.
 
 Please advise,
 
 If you've got an online doc. about that it will help too.
 
 
 Elias
 
 
 
 --
 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] tricky preg_replace and how to escape the \{occurencenumber}

2002-08-16 Thread lallous

?
$fn = 'test.gif';

echo preg_replace('/(.+?)(\..+?)/', '\1a\2', $fn);

?

This script will output 'testa.gif'

now how can i make it produce 'test1.gif' ?

if i replace the: '\1a\2' with '\11\2' it will understand to replace with
occurence number 11 !
How can i escape the 2nd '1' so it is considered as a string an not another
number.


Elias



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




Re: [PHP] tricky preg_replace and how to escape the \{occurencenumber}

2002-08-16 Thread lallous

James,
Actually the interpreter will evaluate the '\1'. '1' . '\2' into one string
before passing it to preg_replace
So it will yield up as I originally wrote it, and it won't work.


Elias

Jason Wong [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Friday 16 August 2002 19:49, lallous wrote:
  ?
  $fn = 'test.gif';
 
  echo preg_replace('/(.+?)(\..+?)/', '\1a\2', $fn);
 
  ?
 
  This script will output 'testa.gif'
 
  now how can i make it produce 'test1.gif' ?
 
  if i replace the: '\1a\2' with '\11\2' it will understand to replace
with
  occurence number 11 !
  How can i escape the 2nd '1' so it is considered as a string an not
another
  number.

 Try:

   echo preg_replace('/(.+?)(\..+?)/', '\1'. '1' . '\2', $fn);

 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *

 /*
 IBM's original motto:
 Cogito ergo vendo; vendo ergo sum.
 */




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




[PHP] Re: tricky preg_replace and how to escape the \{occurencenumber}

2002-08-16 Thread lallous

Oh well,

I could have solved it w/ too many other methods, but how can I escape the
\{occurence} as in my case?

Elias

B.C. Lance [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 and if you are gonna append '1' for all extension,

 try this:
 echo preg_replace('/(\..+?)/', '1$1', $fn);

 Lallous wrote:
  ?
  $fn = 'test.gif';
 
  echo preg_replace('/(.+?)(\..+?)/', '\1a\2', $fn);
 
  ?
 
  This script will output 'testa.gif'
 
  now how can i make it produce 'test1.gif' ?
 
  if i replace the: '\1a\2' with '\11\2' it will understand to replace
with
  occurence number 11 !
  How can i escape the 2nd '1' so it is considered as a string an not
another
  number.
 
 
  Elias
 
 




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




[PHP] Re: Array query - finding the key for a value

2002-08-16 Thread lallous

can do this:

$array = array('apple', 'pear', 'orange', 'apricot');

$array = array_flip($array);

$keyword = 'orange';
echo found '$orange' @ index: . $array[$keyword];

Don't use this method though! It makes your program slow!



Elias

Tim Fountain [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 This may be a silly question, but I'm used to being able to find PHP
 functions to do whatever I want, but I can't find one to do this!

 If I have an array like this:

 [0] - 'apple';
 [1] - 'pear';
 [2] - 'orange';
 [3] - 'apricot';

 I know I can use in_array() to check whether, say, 'orange' is in the
 array; but how do I then find out which index 'orange' is at?

 --
 Tim Fountain ([EMAIL PROTECTED])
 http://www.tfountain.co.uk/




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




[PHP] Re: Troubles with Classes

2002-08-14 Thread lallous

try to put any code inside the new class' constructor part,
- move the this code:
  $DBQuery = new DBQueries;   --- this
 is line 134
  $DBQuery-attrib[type] = select;
  $DBQuery-attrib[query] = SELECT ID_Secpage, PageType,

into :
 class SubMenu {
SubMenu()
 {
  $this-DBQuery-attrib[type] = select;
  $this-DBQuery-attrib[query] = SELECT ID_Secpage,
PageType,
 }
}

Elias
Jadiel Flores [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hey guys, I have a little problem here, I have one class to create queries
 to a mysql database, this class works fine, but, now I want to create an
 instance of this class inside another class but I'm receiving the error:

 Parse error: parse error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION
 or T_FUNCTION or T_VAR or '}' in
 D:\InetPub\hispanicroot\includes\database.php on line 134

 This is my code:

 class SubMenu {
  var $attrib = array(level=, page=, section=);
  $DBQuery = new DBQueries;   --- this
 is line 134
  $DBQuery-attrib[type] = select;
  $DBQuery-attrib[query] = SELECT ID_Secpage, PageType,
 Title, PageURL FROM inf_secpages WHERE ID_Page =  . $attrib['page'] . 
 ORDER BY Slot ASC;
  $GetData = $DBQuery-RunQuery();
  bla bla bla ..
 }

 If I use:
  var $DBQuery = new DBQueries;
 then I receive the error:
  Parse error: parse error, unexpected T_NEW in
 D:\InetPub\hispanicroot\includes\database.php on line 134

 Thanks


 Jadiel Flores
 -
 http://www.abargon.com
 [EMAIL PROTECTED]
 (52-55) 52-29-80-34





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




[PHP] Re: fopen and sort by date modified

2002-08-14 Thread lallous

checkout:

opendir()
readdir()
fstat()
closedir()

Elias
Electroteque [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hi there i was wondering how i could fopen a directory and then sort the
 files by date modified is there a way ?





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




[PHP] help with making appropriate indexes.

2002-08-14 Thread lallous

give this query:

  SELECT
table_routing.id  AS   routeid,
table_pricing.units   AS   price,
table_routing.providerAS   providerid,
table_country.nameAS   countryname,
table_country.id  AS   countrycode
  FROM
table_pricing,
table_routing,
table_country
  WHERE
table_country.id = table_routing.country
   AND
table_routing.country = table_pricing.country
   AND
table_routing.provider = table_pricing.provider
   AND
table_country.enabled = 1
  ORDER BY routeid

what keys / indexes should I create on whatever tables to make this query
efficient?
I don't know if this query can be re-written even with JOINs and stuff.

Please advise,

If you've got an online doc. about that it will help too.


Elias



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




[PHP] Re: Destroy session variable when IE close

2002-08-14 Thread lallous

Afaik, the session will die automatically when IE gets closed.
Or at least the cookie that links to that session.

Elias

Christian Ista [EMAIL PROTECTED] wrote in message
000101c24384$442ab9b0$c000a8c0@p3portable">news:000101c24384$442ab9b0$c000a8c0@p3portable...
 Hello,

 Is it possible to set to null (or destroy) the session variables when I
 close IE ?

 Bye




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




[PHP] Re: [Class] Behaviour global variables

2002-08-14 Thread lallous

hmmmwhat are you missing?

globals $a and $b are not defined!

try to set error reporting to E_ALL and try running your code again.

Elias

Tim Stoop [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi there,

 I'm forgetting something, but I can't seem to get to it... Consider the
 following Class.

 class Test
 {
 var $a;
 var $b;

 function Test()
 {
 $this-a = 2;
 $this-b = 5;
 }

 function Show()
 {
 global $a, $b;

 echo(a: .$a);
 echo(a: .$this-a);
 echo(b: .$b);
 echo(b: .$this-b);
 }
 }

 After proper initialisation, calling the function Show() gives:

 a:
 a: 2
 b:
 b: 5

 What am I forgetting here? Tia for answers!

 --
 Kind regards,
 Tim



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




[PHP] Re: A kind of array (hashtable)

2002-08-13 Thread lallous

Yes, PHP support indexing by strings and not only numbers/indexes.

$myarray['elias'] = 'PHP rulez!';

echo $myarray['elias'];

Christian Ista [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 In some language (like Java, C#, ...) you can find a hashtable.

 I execute query, this query return some records, each records are composed
 by 2 fields. I'd like to put these records in a 2 dimensions array (or
 something like that) and find easily the records I want.

 An example, the query return (field1/field2):

 mytext1/ text for my text 1
 mytext2/ text for my text 2
 mytext3/ text for my text 3
 mytext4/ text for my text 4

 I'd like to put that in an array, but not find the text by myarray[2],
 myarray[4] but by myarray['mytext2'], ['mytext2'] have to return text for
 my text 2

 Possible to do that ?

 Bye






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




[PHP] Re: parse URL good syntaxe please

2002-08-13 Thread lallous

you can use isset()

better grab a PHP starter document or tutorial.

Elias

Christian Ista [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 Could you tell me why on PHP 4.2.2 this code work

 ?php
   switch ($_GET['fuseaction'])
  {
 case 0:
 print i equals 0;
 break;
 default:
 print i is not equal to 0, 1 or 2;
  }
 ?

 and this one not :

 ?php
   switch ($fuseaction)
  {
 case 0:
 print i equals 0;
 break;
 default:
 print i is not equal to 0, 1 or 2;
  }
 ?

 In both cases when fuseaction is not defined, I receive an error. Could
you
 tell me how to know if the variable is defined in the URL. In coldfusion
you
 can do cfif isDefined(URL.fuseaction)

 but in php ?

 Bye





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




[PHP] Re: Loading Extension...

2002-08-12 Thread lallous

;extension=php_pdf.dll

you have to uncomment that line above inside php.ini

Elias

Brian McGarvie [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 OK Help

 I always seem to have trouble installing extensions... what am I doing
 wrong? (trying to get PDFLib working).

 I copied the DLL to c:\php\extensions\php_pdf.dll

 However when I try to run a simple example I get:

 Fatal error: Call to undefined function: pdf_new() in
 C:\Inetpub\wwweloanshop\dev\test\hello.php on line 4

 Anyone...





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




[PHP] Re: add options to select in ather page

2002-08-12 Thread lallous

oh well,

it is done via javascript:

script
existingSelectBox[existingSelectBox.length] = new Option(display text,
item value, false);
/script

replace the display text , item value from the popup's selected field
value/text

good luck,

Wakan [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,
 I've listbox with some categories in a page.
 When I find that there isn't the category I want, clicking on a link,
 I enter in the category managment page.
 After adding new categories, whenI close that window,
 I'd like to dinamically reload the select on the opener page, without
 reload all the page.
 This because there are other field before the category list.
 If the user has already filled other field and I reload, he have to refill
 that field again.
 Thanks, Carlo





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




[PHP] CURL's different Options values and their format

2002-08-12 Thread lallous

As you can see that every Option (parameter) when calling curl_Setopt
requires a different mixed value format.

where can i find a full description of how to use each of curl's options ?


I mainly want to login to a page via curl
have curl maintain the cookies
post some fields while logged in
then log off.

but i still need to learn how to use each of the options used  in PHP.

can anyone recommend a good site?

Thank you.



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




Re: [PHP] progress bar

2002-08-12 Thread lallous

I agree with the flush() solution.

In addition, output a javascript code to update the display in the
browser...
for example:
scriptdocumeny.theform.progressPercent.value++/script

Elias
Tom Kohnen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi!
 Well i suppose flush() is useful in your case, flush out the output
whenever
 it is called, and not when the page is fully generated (the usual case)!
 Sou you might to sth like this:

 - Print 1/4 of the progress bar
 - flush
 - wait some time
 - print 2/4 of the progress bar
 - flush
 

 i don't know if it works, but that's the way it'd do it ;)

 - Tom

 -Original Message-
 From: Serdar Sokmen [mailto:[EMAIL PROTECTED]]
 Sent: Monday, August 12, 2002 12:06 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] progress bar


 Hi,

 I would like to add a progress bar to an installtion program I'm writing
in
 PHP. I basically have one function that I call, it takes about 30 seconds
or
 so to finish executing... I haven't done such a thing before. Can anyone
 plese suggest me some ideas...

 Many Thanks

 Serdar



 --
 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] Re: Pictures and sound in MySQL and access via PHP

2002-08-10 Thread lallous

Personally I wouldn't store BIG files (like .mp3) into the database.

If you insist checkout the mysql LOAD_FILE()

Elias

Danny [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hi,

 I already posted this message but the time on my computer was wrong (26/07
 so i post it again).

 I am new on MySQL and PHP.
 I'm making a on-line dictionary. I use PHP and a MySQL Database.
 Now I want to add audio-streaming (MP3) and pictures (JPG) to the database
 and retrieve it true PHP. Can sombody help me out with a little
 example-code?
 The database is working well (only text).

 Danny







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




[PHP] Re: Checking Session Vars in Functions

2002-08-09 Thread lallous

try to check if a session is session or not via:

session_is_registered()


Elias

Monty [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have PHP 4.2.2 with register_globals=off.

 It seems like session vars stored in $_SESSION[] aren't visible to
 functions. For example, this won't work for me:

 $status = user_access();

 function user_access() {
   if ( isset($_SESSION['user']) ) { return 1; }
   else { return 0; }
 }

 Result is that $status = 0 even though I know those session vars are set.


 if ( isset($_SESSION['user']) ) {
 echo Logged In;
 } else {
 echo Not Logged In;
 }

 Result for the above is Logged In even though I'm checking the same
 session var. My script does include session_start(); as well.

 So, is there a way I access session vars stores in $_SESSION[] from a
custom
 function? Thanks!

 Monty




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




[PHP] Re: Passing Array from one form to another form

2002-08-09 Thread lallous

this can be done through many ways:

1. serialization: serialize() the array and then send it as a string,
deserialize it back in form2
2. join the arrays with a seperator and send as one string, and split it
back in form2
3. use hidden fields with same name whose name is similar too: hiddenfield[]
, and output something like:
input type='hiddenfield[]' value='array element0'
input type='hiddenfield[]' value='array element1'
input type='hiddenfield[]' value='array element2'
upon submition, form2 will receive an array called $hiddenfield with the
correct values!

good luck,
Elias

J.F.Kishor [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello all,

I have got a doubt, Is there a way to pass a array from one
 from to another form while submition.

 I have tried to do it, but in the second form I just get the string
 ARRAY  I'am not able to get the expected result.

 Please let me know if there is a way to do the above.


 Thanks in adv,

 Cheers,

 kishor
 Nilgiri Networks








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




Re: [PHP] isset($var) !empty($var) same time!

2002-08-03 Thread lallous

Just use empty() ?!

With error_reporting(E_ALL) you'll get a bunch of warnings if you only use
empty() w/o the isset() !

use isset() first and then check wheter empty or not empty!

so there is not one function that tests for empty and isset same time!?

Elias
Analysis  Solutions [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Fri, Aug 02, 2002 at 04:48:17PM +0200, lallous wrote:
 
  function issne($var)
  {
 return isset($var)  !empty($var) ? true : false;
  }
 
  is there is any builtin function that does that? (one function call).

 Yes.  Just use empty().  It automatically checks if the variable is:
not set
null
an empty string
zero

 If any of them are true, the empty() function returns true.  You don't
 need your function at all.

 --Dan

 --
PHP classes that make web design easier
 SQL Solution  |   Layout Solution   |  Form Solution
 sqlsolution.info  | layoutsolution.info |  formsolution.info
  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
  4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409



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




[PHP] Re: Protect PHP coding

2002-08-03 Thread lallous

any windows version of this product?


Manuel Lemos [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 On 08/02/2002 11:06 AM, Lallous wrote:
  So...
  Is this equivalent to Zend Encoder?

 Not exactly, but in some aspects it is/will be better like the ability
 to generate executable standalone PHP programs that you can distribute
 independently. There is also the question of the price that for Zend
 Encoder is ridiculously expensive.

 Other than that, if you're main concerne is protecting your PHP code,
 you can do very well with bcompiler.


  Elias
  Manuel Lemos [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
 Hello,
 
 On 08/01/2002 01:58 PM, Yc Nyon wrote:
 
 Is there any method to encrypt PHP files.
 
 Use bcompiler which is free and is part of PEAR/PECL official PHP
 extensions repository:
 
 http://pear.php.net/package-info.php?pacid=95
 
 --
 
 Regards,
 Manuel Lemos
 
 
 
 



 --

 Regards,
 Manuel Lemos




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




Re: [PHP] isset($var) !empty($var) same time!

2002-08-03 Thread lallous

because your variable is set already!

try doing this:

echo empty($asdadadadadadasd);
you will get a warning and have a FALSE value.


Elias
Verdana Musone [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I always set error_reporting(E_ALL) oR error_reporting(2047), but i have
never got any errors when just use empty()
to determine whether a variable is set.

If the variable is: 0, null, not set or an empty string.
Then the empty() will return true.

It's unnecessary to call isset() first.

- Original Message -
From: lallous
Sent: 2002Äê8ÔÂ3ÈÕ 15:01
To: [EMAIL PROTECTED]
Subject: Re: [PHP] isset($var)  !empty($var) same time!

Just use empty() ?!

With error_reporting(E_ALL) you'll get a bunch of warnings if you only use
empty() w/o the isset() !

use isset() first and then check wheter empty or not empty!

so there is not one function that tests for empty and isset same time!?

Elias
Analysis  Solutions [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Fri, Aug 02, 2002 at 04:48:17PM +0200, lallous wrote:
 
  function issne($var)
  {
 return isset($var)  !empty($var) ? true : false;
  }
 
  is there is any builtin function that does that? (one function call).

 Yes.  Just use empty().  It automatically checks if the variable is:
not set
null
an empty string
zero

 If any of them are true, the empty() function returns true.  You don't
 need your function at all.

 --Dan

 --
PHP classes that make web design easier
 SQL Solution  |   Layout Solution   |  Form Solution
 sqlsolution.info  | layoutsolution.info |  formsolution.info
  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
  4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.phpGet more from the Web.
FREE MSN Explorer download : http://explorer.msn.com




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




[PHP] Re: Need help to choose hosting!

2002-08-02 Thread lallous

have you tried:

http://www.hostrix.com

?

//Elias
Mantas Kriauciunas [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hey php-general,

   i want to buy hosting. but i can't find good one for me. maybe
   someone could point some links. but this is what i need!

   Storage up to 100MB
   normal transfer limit(best would be without)
   CGI/Perl/PHP/ASP/SSI/SSL
   MySQL database (can be only 1)
   some pop3 mailboxes
   free domain transfer (maybe free domain if i pay for 1 year ahead)
   FTP access
   SSH access
   Shell capability
   up to 3 background processes

   if anyone know combination like that i would appreaciate your help!
   thanks

 --
 Best regards,
  Mantas

 Contacts:
 [EMAIL PROTECTED]




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




[PHP] Re: Why do i get this Notice Message?

2002-08-02 Thread lallous

In your function do this:
 function WriteNewArticle()
 {
GLOBAL $PHP_SELF;

...
}


//Elias

JüRgen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello!

 Could someone please tell me why i get the following Notice Message

 Notice: Undefined variable: PHP_SELF in
 g:\apache_web\intern\looney\index.php on line 101

 Code affected:

 function WriteNewArticle()
 {
 Line 100:  $smarty = new Smarty;
 Line 101:  $smarty-assign(PHPSELF, $PHP_SELF);
 // etc.

 Thanks alot in advance for your time,
 Jürgen






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




Re: [PHP] Why do i get this Notice Message?

2002-08-02 Thread lallous

even on old versions of PHP,
he can then just use: $GLOBALS['PHP_SELF'] w/o worrying about the Global
keyword!

Elias
John Holmes [EMAIL PROTECTED] wrote in message
001001c23a1e$601f5050$b402a8c0@mango">news:001001c23a1e$601f5050$b402a8c0@mango...
 Could someone please tell me why i get the following Notice Message

 Notice: Undefined variable: PHP_SELF in
 g:\apache_web\intern\looney\index.php on line 101

 Code affected:

 function WriteNewArticle()
 {
 Line 100:  $smarty = new Smarty;
 Line 101:  $smarty-assign(PHPSELF, $PHP_SELF);
 // etc.

Why? Because $PHP_SELF is an undefined variable. There is nothing
assigned to it and you're trying to use it in a function.

But, you say, $PHP_SELF is supposed to be the current page. Yes,
normally it would with register_globals ON, but you are inside of a
function, so it is a whole new variable now.

So, like someone else suggested, make it global inside your function

Global $PHP_SELF;

Or, if you're on a new version, just use $_SERVER['PHP_SELF'] and you
don't have to worry about global.

---John Holmes...




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




[PHP] Re: Undefined Index

2002-08-02 Thread lallous

do this:

$op = isset($_GET['op'])  !empty($_GET['op']) ? $_GET['op'] : '';


JüRgen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 It's me again, i don't mean to be a bugger, but i really like to learn as
 much as possible, that's why i ask (or will ask so many questions).

 Consider the following (i shortened this a lot, but it will do the trick)

 $op = $_GET['op'];
 switch ( $op )
 {
  case admin:
   DoLogin();
   break;

  default:
   ShowHomepage();
   break;
 }

 PHP shoots a Notice Message telling me that there is an undefined index
 Undefined index: act in g:\apache_web\intern\looney\index.php on line 177

 This accects the code shown above.

 Ok, am i correct in assuming that it pops this message because $op is not
 defined as anything yet?

 If so,should i always just do this

 $_POST['op'] = '';
 $op = $_GET['op'];
 switch ( $op )
 {
 //Code here
 }

 Or would it be better and more space efficient to do this
 $op = isset($_GET['op']);
 switch ( $op )
 {
 //Code here
 }
 Cause if i do that the Notice Message dissapears for some reason i yet
fail
 to grab.
 I would really appreciate if somebody could explain to me why the Notice
 dissapears when using isset(), and also what is the best method to use
 rather then the two shown above?
 How do you guysgirls handle this?

 Thanks a lot in advance for your time and patience!

 Best regards from Vienna,
 Jürgen






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




[PHP] include hassle

2002-08-02 Thread lallous

I have this:

//file1.php
?
include('../libs/lib1.php');
..
..
..
?

now lib1.php:
?
include ('helper.php');
?

If i run file1.php -includes lib1.php - fails to include helper.php ! !

how can i solve that?

p.s: currently, i'm chdir()ing to the ../libs path, then i return to current
dir...
my code cannot make use of Apache's help. (like setting the include path
inside .htaccess)

thank you,
Elias



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




[PHP] Re: Protect PHP coding

2002-08-02 Thread lallous

So...
Is this equivalent to Zend Encoder?

Elias
Manuel Lemos [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 On 08/01/2002 01:58 PM, Yc Nyon wrote:
  Is there any method to encrypt PHP files.

 Use bcompiler which is free and is part of PEAR/PECL official PHP
 extensions repository:

 http://pear.php.net/package-info.php?pacid=95

 --

 Regards,
 Manuel Lemos




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




[PHP] Re: Favorite Calendar Anyone?

2002-08-02 Thread lallous

have you searched hotscripts.com ?


Shane [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Anyone have a favorite Calendar script out there they would like to share?

- NorthBayShane



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




Re: [PHP] include hassle

2002-08-02 Thread lallous

I mean this:

i have this tree:

./libs/*.php
./user/file1.php

now i'm in ./user/ directory
i run file1.php
it includes ../libs/lib1.php which in turn will include helper.php
(./users/helper.php) -- will fail!

how can i programmatically set the include path?

Elias

Reuben D. Budiardja [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Friday 02 August 2002 10:02 am, lallous wrote:
 I have this:
 //file1.php
 ?
 include('../libs/lib1.php');
 ?
 now lib1.php:
 ?
 include ('helper.php');
 ?
 If i run file1.php -includes lib1.php - fails to include helper.php ! !
 how can i solve that?

We need more information that this. What's the error message? what do you
mean
fails?
In anycase, you should be able to run lib1.php first without error, before
trying file1.php. If the former causes error, resolve that first.

rdb




 p.s: currently, i'm chdir()ing to the ../libs path, then i return to
 current dir...
 my code cannot make use of Apache's help. (like setting the include path
 inside .htaccess)

 thank you,
 Elias




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




[PHP] Re: question about references

2002-08-02 Thread lallous

yes, true!

try this patch:
 if (strcmp($name-firstName, homer) == 0) {
 echo changing homer to margebr;
 $name-firstName = marge;
$names[key($names)]-firstName = marge;

good luck,

Elias

Jesse Vitrone [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Tried to post this to the news group before, but I'm having trouble
getting
 to my news server from work - hopefully I'm not posting a duplicate.


 I think I'm seeing the problem I'm seeing because I'm getting a copy of a
 var instead of a reference to it, but I'm not sure the best we to get
around
 this problem.

 In my little sample script, I've got an array of objects.  When I use
 foreach to loop through the array and make a change to an item, it doesn't
 change the object in the array, just the var that I have while I'm in the
 foreach loop.

 What's the right way to loop through this array if I really want to change
 homer's name to marge in this example?  The way it is now, I see my echo
 saying that I'm changing the name, but when I do the second var_dump, it's
 the same as the first var_dump.

 Thanks in advance,
Jesse

 ?php

 class Name {
 var $firstName;
 var $lastName;

 function Name($first, $last) {
 $this-firstName = $first;
 $this-lastName = $last;
 }
 }

 $names[] = new Name(joe, shmo);
 $names[] = new Name(billy, bob);
 $names[] = new Name(homer, simpson);

 ?

 html
 body
 ?php echo var_dump($names) ?
 br
 ?php
 foreach ($names as $name) {
 if (strcmp($name-firstName, homer) == 0) {
 echo changing homer to margebr;
 $name-firstName = marge;
 break;
 }
 }
 ?
 ?php echo var_dump($names) ?

 br
 /body
 /html




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




[PHP] isset($var) !empty($var) same time!

2002-08-02 Thread lallous

I have wrote this function:

function issne($var)
{
   return isset($var)  !empty($var) ? true : false;
}


which can be called as: if (issne($mightbeundefinedvariable)) echo using
this variable;


is there is any builtin function that does that? (one function call).


//Elias



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




Re: [PHP] Storing script in database??

2002-08-01 Thread lallous

I agree with Justin!

Probably your best solution is to write your own mini script and write an
interpreter for it!

Elias
Justin French [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm pretty sure you can use eval() on a string, but tread with caution,
and
 try to look around for security concerns.

 I certainly wouldn't eval() anything supplied by a user... no way.


 Justin French


 on 01/08/02 7:53 PM, David Pratt ([EMAIL PROTECTED]) wrote:

  I am creating an application where it would be useful to write and store
  script in a field in a MySQL database and create a loop to process the
array
  of the code contained in the field. Conceptually, I think it sounds
  reasonable but I am uncertain of what kind of process I could use to
have
  the code in the field variable read properly within the loop.  Somewhat
  analogous to an include in HTML.
  The file would be read as though a single script file though the
included
  material has come from a text field.
 
  This would be really useful for me since the code could be modified in
the
  database outside a smaller application without changing the files.  Any
  ideas here on how I might do this from anyone that has attempted
anything
  similar?  I have set everything up but just can't figure out how to
bring
  the script text in the field into the file properly. Help much
appreciated.
  --
 
  Dave Pratt
  [EMAIL PROTECTED]
 




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




[PHP] Re: Disabling Browser BACK button

2002-08-01 Thread lallous

see: http://lgwm.org/trap.htm

try to use the same mechanism.

Elias
Petre [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 HI
 Is there a way I can disable the client's browser back button, forcing
 them to use the navigation I built into the page?
 Ideally, when they try to press BACK on browser, a popup asking them
 to use the navigation instead would win first prize.

 The reason I'm asking is again to do with sessions, I have an app
 running 100% now without using cookies, but if the user hits BACK and
 ignores the expire warning, the app produces unwanted results ( adds
 form data again to the db etc.)
 Just want to patch the holes.

 Maybe write my own little browser that has no back button??





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




[PHP] Re: extracting variables from files

2002-08-01 Thread lallous

try str_replace()
or preg_replace()

Elias,

Nick Wilson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hi everyone,

 I break out in a cold sweat just thinking about regex, so I thought I'd
 ask you if there was an easier way to do this:

 I want to look through all of the files in a directory and extract a
 certain variable from each.

 This is to create a dynamic menu of the directory: The files are php
 scripts that assign $title (among others) to Smarty templates.

 I need to get $title from each file

 I had a look through the docs and didn't see anything obvious, which is
 why I'm here :-)

 Many thanks...
 - --
 Nick Wilson // www.tioka.com



 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)

 iD8DBQE9SEtnHpvrrTa6L5oRAuVyAJ4j4jfC4nKKni3S6V5xsmZH2xhPDQCdF7wA
 Y0vShZPQ1n5qZE48LIhCVyA=
 =DLPZ
 -END PGP SIGNATURE-



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




[PHP] Re: SMS message ?

2002-07-31 Thread lallous

Lots of pay sites allow you to send SMS programmatically...

check for example www.smsxchange.com


Rija [EMAIL PROTECTED] wrote in message
035c01c2383d$b39df7f0$3d00a8c0@workelp3">news:035c01c2383d$b39df7f0$3d00a8c0@workelp3...
Hi all,
I'm a newbie, and I'd like some advice, and I don't have any idea, maybe
it's a silly question.

Is-it possible to send SMS message to mobile phone using PHP?

For example, every monday I send some news about my web site to the mobile
phone of my visitors with their approval, of course.

If possible, how to do it.
If not, does anyone have any other ideas how to do this?


Best regards,

Ranaivo Rija
[EMAIL PROTECTED]
BP 1528 Port Vila
Vanuatu



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




[PHP] Re: Bcc with the mail command

2002-07-31 Thread lallous

Yes, the header can contain this:
$mailheader=Bcc: [EMAIL PROTECTED]\r\nTo: [EMAIL PROTECTED];

Elias,

Carlos Fernando Scheidecker Antunes [EMAIL PROTECTED] wrote in
message 012301c23874$982a5c70$93505ad1@Nando0">news:012301c23874$982a5c70$93505ad1@Nando0...
Hello all,

Just a question about PHP mail comand.

Usually I have something like this:

if (mail($to,$Subject,$Body,$MailHeaders)) {
return 1;
}
else {
return 0;
}

Is there any way to use a BCC instead of to?

I would like that the message sent did not have the address of the person it
is sending it to.

Any ideas or suggestions?

Thank you,

Carlos Fernando.




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




[PHP] extending class then calling its original function

2002-07-31 Thread lallous

Hello when I extended a class and overwrite a function, can i after
overwriting that function call it so it does what it used to do?

for example in Delphi I say:

procedure TMyExtendedClass.Proc1;
begin
// do new stuff here
inherited; // calls the TMyClass.Proc1;
end;


Elias



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




[PHP] Re: stripping quotes within an image tag

2002-07-31 Thread lallous

?
echo preg_replace('/(img.+?src=)([^]+)([^]*)/i', '\1\2\3', 'IMG
height=44 alt=hspace=0 src=blah.jpg width=148 border=0');
?

Elias,

Electroteque [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hi how is it possible to strip quotes from an image tag ?
 i need
 IMG height=44 alt=hspace=0 src=blah.jpg width=148 border=0

 to look like
 IMG height=44 alt=hspace=0 src=blah.jpg width=148 border=0





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




[PHP] Re: stripping quotes within an image tag

2002-07-31 Thread lallous

that won't really work if he used the ALT attribute too:
img alt=Hello world image src=helloworld.jpg 


David Robley [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] says...
  hi how is it possible to strip quotes from an image tag ?
  i need
  IMG height=44 alt=hspace=0 src=blah.jpg width=148 border=0
 
  to look like
  IMG height=44 alt=hspace=0 src=blah.jpg width=148 border=0
 
 
 
 $string_no_quotes = str_replace('', '',$yourstring);

 if the tag can be placed in a variable/

 --
 David Robley
 Temporary Kiwi!

 Quod subigo farinam



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




[PHP] Re: DOMXML...

2002-07-31 Thread lallous

hmm!

1)Can you show the code @ line 36 if possible
2)try to escape the \ (replace every \ with \\)


Brian McGarvie [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have a problem with DOMXML...

 I installed it and it is showing up in a phpinfo() script...

 However when I try a simple example it gives me an error such as:

 Warning: failed to load external entity employees.xml in
 C:\Inetpub\wwweloanshop\test\xml.php on line 36

 Any hints?

 [ Brian M McGarvie | www.mcgarvie.net  - www.the-local-guide.com -
 www.anypurposeloans.com ]





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




[PHP] Re: shorter way to write include function?

2002-07-31 Thread lallous

if dotest.php has got the code, do this:

echo eval(join('', file('dotest.php'));



Bas Jobsen [EMAIL PROTECTED] wrote in message
02073113582400.32156@bjobsen">news:02073113582400.32156@bjobsen...
 Hello,

 i have
 /include/dotest.php:
 ?
 function dotest() {echo 'test';}
 ?

 and test.php:
 ?
 include('/include/dotest.php');
 dotest();
 ?

 Us there a shorter way to write out that. I mean something like

 include::dotest;

 Thanks,







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




[PHP] Re: There has to be a more elegant way of doing this

2002-07-31 Thread lallous

NEWSTRING = preg_replace( array(/WHAT TO SEARCH FOR ARRAY/), array(/WHAT TO
REPLACE WITH ARRAY/), STRING)


Mike [EMAIL PROTECTED] wrote in message
007201c23891$4fee8400$[EMAIL PROTECTED]">news:007201c23891$4fee8400$[EMAIL PROTECTED]...
 Heya,
 I was just wondering If there is a more elegant way of doing this...

 $string =
 str_replace('%mp3number%',$ARRAY['mp3number'],str_replace('%file_size%',
 $file_size,str_replace('%url%',$url,str_replace('%title%',$title,str_rep
 lace('%artist%',$artist,$format)

 Thank You,
 Mike
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]





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




[PHP] Re: Resetting ID

2002-07-30 Thread lallous

Save all the entries somewhere programmatically,
then do DELETE * FROM tablename;
re insert all the entries (of course do not enter the ID field, cause it
will be auto assigned).

gl,

Thomas Edison Jr. [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Glory!

 I have a table, with 4 columns. One of the column is
 ID, a Primary Key, which has Auto_Increment set on it.


 Now i have a lot of rows deleted and a lot of
 duplicate rows that will be deleted, and all sorts of
 stuff happening in the table.. the result is, that the
 IDs have become inconsistent.

 What you get is something like
 5,6,9,10,25,32,33 .. and so on. With many IDs missing
 etc.

 What i want to do is delete the entire IDs and
 generate them again so that they are in one single
 order like 1,2,3,4,5... .like this.

 And so that any new entry in the table gets the ID
 accordingly. How can i do this?

 Thanks,
 T. Edison Jr.



 __
 Do You Yahoo!?
 Yahoo! Health - Feel better, live better
 http://health.yahoo.com



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




[PHP] Re: MYSQL natsort() ?

2002-07-30 Thread lallous

Well, you can do something like:


SELECT * FROM tablename
ORDER BY fieldname [ASC|DESC]

= [ASC|DESC] optional, put either of theses without the brackets.

//Elias.

Joel Colombo [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 This is a mysql question, cause i can do it with a natsort in php.
 question is can u do it directly in the MYSQL SELECT ?
 I am wondering if the SELECT statement can have a natural order by.

 Table has 5 rows.
 field name number
 values :
 10
 2
 15
 30
 150

 a regular order by number: generates results 10,15,150,2,30

 i need a natural sort
 2,10,15,30,150

 is there a way to sort FLOAT valuse like this using an order by with a
combo
 of other functions or something ?

 Thanks
 Joel











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




[PHP] Re: fullname

2002-07-30 Thread lallous

Even more,

$fullname = {$session['f_name']} {$session['l_name']};

even

$fullname = sprintf(%s %s, $session[f_name], $session['l_name']);

etc

Mantas Kriauciunas [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hey php-general,

   is there some other easyer way to do in one line than this?:

 $fullname = $session[f_name];
 $fullname .=  ;
 $fullname .= {$session['l_name']};

 P.S the thing is to add line in the middle of the first and last names
 :)

 Thanks
 --
 Best regards,
  Mantas

 Contacts:
 [EMAIL PROTECTED]




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




[PHP] Re: Create a link where http://

2002-07-29 Thread lallous

?
$mem = Hello world! http://www.helloworld.com\n

Hello world! ftp://ftp.server.com\n

Hello world www.helloworld.com;

// code starts here

$mem = preg_replace (/\s+([http:|ftp:]{0,1}\S+\.\S+)/me, ' A href=\'.

(ereg('^[http:|ftp:]','\\1')

? '\\1\\\1/A'

: 'http://\\1\;http://\\1/A'), $mem);

print ($mem);

?

good luck,

Jesse Lawrence [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 Hello there, I'm putting together a message board, and
 would like to automatically turn any instance of
 http://whatever into a link, without requiring the
 viewers to enter html.  I'm thinking regex is probably
 the way to go with this, but I'm not really seeing how
 to do it.  If someone could point me towards a
 solution, it would be greatly appreciated.

 Thanks very much,
 Jesse Lawrence
 http://soniceast.d2g.ca/jesse/

 __
 Post your ad for free now! http://personals.yahoo.ca



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




  1   2   >