[PHP] Re: Simple question on simplexml

2007-04-09 Thread Timothy Murphy
Haydar TUNA wrote:

  You can use following example:)
 
 ?php
   $xml = simplexml_load_file(test.xml);
   $xml-body[0]-addChild(book, Atat�rk The Rebirth Of A Nation);
 ?

This doesn't work.
It allows to add a child with some text, as in your example.
But it doesn't allow you to add a tree, ie a node with sub-nodes,
which is what I was looking for.

If it does, could you give an example where eg the item to add is
book
  authorSmith, J/author
  titlePHP for dummies/title
  publisherOUP/publisher
/book

 I have a catalog in XML format:
 ?xml version=1.0 encoding=iso-8859-1 ?
 catalog
  book
...
  book
  book
...
  book
  ...
 /catalog

 Now I want to add another book,
 which I have as a SimpleXMLElement:

$book = new SimpleXMLElement($string);

 where $string reads
  book
...
  book

 Can I add this new entry to the catalog
 using SimpleXML functions,
 or do I have to introduce a DOMDocument?

 As may be obvious, I am very new to PHP programming;
 and advice or suggestions gratefully received.

 --
 Timothy Murphy
 e-mail (80k only): tim /at/ birdsnest.maths.tcd.ie
 tel: +353-86-2336090, +353-1-2842366
 s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland
 

-- 
Timothy Murphy  
e-mail (80k only): tim /at/ birdsnest.maths.tcd.ie
tel: +353-86-2336090, +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland

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



[PHP] Re: Simple question on simplexml

2007-04-09 Thread Timothy Murphy
Jochem Maas wrote:

 there is this:
 
 http://php.net/manual/en/function.simplexml-element-addChild.php
 
 which will allow adding of string data (so you won't be needing to
 create the new SimpleXMLElement object as per your example below).
 
 obviously you will have to first load tghe complete xml document
 into simplexml using one of the following:
 
 http://php.net/manual/en/function.simplexml-load-file.php
 http://php.net/manual/en/function.simplexml-load-string.php

I tried this, with several variations,
and I have come to the conclusion that it is impossible
to add a tree to a node as I asked using only simplexml functions.
If you have such a solution, I would love to see it.

If you would like an example, I might want to add the item:
book
  authorSmith, J/author
  titlePHP for dummies/title
  publisherOUP/publisher
/book

My solution, for what it is worth, is something like
-
$docA = new DOMDocument;
$docB = new DOMDocument;

$docB-loadXML($book);

$xpath = new DOMXPath($docB);
$nodes = $xpath-query('//catalog/book');
foreach($nodes as $n) {
  $new = $docA-importNode($n, true);
  $docA-documentElement-appendChild($new);
}

$output = $docA-save(/tmp/catalog.xml);
-

 Timothy Murphy wrote:
 I have a catalog in XML format:
 ?xml version=1.0 encoding=iso-8859-1 ?
 catalog
   book
 ...
   book
   book
 ...
   book
   ...
 /catalog
 
 Now I want to add another book,
 which I have as a SimpleXMLElement:
 
 $book = new SimpleXMLElement($string);
 
 where $string reads
   book
 ...
   book
 
 Can I add this new entry to the catalog
 using SimpleXML functions,
 or do I have to introduce a DOMDocument?

-- 
Timothy Murphy  
e-mail (80k only): tim /at/ birdsnest.maths.tcd.ie
tel: +353-86-2336090, +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland

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



[PHP] Re: Simple question on simplexml

2007-04-07 Thread Haydar TUNA
Hello,
 You can use following example:)

?php
  $xml = simplexml_load_file(test.xml);
  $xml-body[0]-addChild(book, Atatürk The Rebirth Of A Nation);
?

Republic Of Turkey - Ministry of National Education
Education Technology Department Ankara / TURKEY
Web: http://www.haydartuna.net

Timothy Murphy [EMAIL PROTECTED], haber iletisinde sunlari
yazdi:[EMAIL PROTECTED]

 I have a catalog in XML format:
 ?xml version=1.0 encoding=iso-8859-1 ?
 catalog
  book
...
  book
  book
...
  book
  ...
 /catalog

 Now I want to add another book,
 which I have as a SimpleXMLElement:

$book = new SimpleXMLElement($string);

 where $string reads
  book
...
  book

 Can I add this new entry to the catalog
 using SimpleXML functions,
 or do I have to introduce a DOMDocument?

 As may be obvious, I am very new to PHP programming;
 and advice or suggestions gratefully received.

 -- 
 Timothy Murphy
 e-mail (80k only): tim /at/ birdsnest.maths.tcd.ie
 tel: +353-86-2336090, +353-1-2842366
 s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland

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



[PHP] Re: Simple question

2003-12-28 Thread Andy Higgins
Hi Lab,

I normally use code of the following format, which I think is quite neat:

//Note that you do not need curely brackets in an if statement is there is
only one line
if ($_SERVER['REQUEST_METHOD'] == 'POST')
$add  = $HTTP_POST_VARS['textbox'];

if ($add == 'Hello')
do something

//It is however recommended that you do the following in order to ensure
that a user does not try to use malicious code in their input

if ($_SERVER['REQUEST_METHOD'] == 'POST')
$add  = clean($HTTP_POST_VARS['textbox'], 20);;

if ($add == 'Hello')
do something

where clean() is a function defined in an include as follows:

function clean($input, $maxlength)
{
$input = substr($input, 0, $maxlength);
$input = EscapeShellCmd($input);
return ($input);
}

Hope that helps.

Regards,
Andy



Labunski [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hello, I have only one simple question..
 I'm using this method to get the values from the text box:

   if(isset($_POST[Submit])  $_POST[Submit]==Submit)
  {
$add = $_POST['textbox'] ;
  }

 But I don't know how to write the source for this:

 If the value from the textbox ($add) is Hello then.. do something.
 I think it could be nicely done with IF, but I dont know how to write
this..

 Can someone help me, please?

 Regards,
 Lab.

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



[PHP] Re: Simple question I guess.

2002-07-23 Thread Richard Lynch

I have a site with all my movies and stuff stored in a database. And I have
made a admin page where I can add, delete and update records. When I add new
records, I have made a listbox for the category (ex. action, comedy etc.) so
I dont have to write it every time I add a new record. But when I push the
update button and the data thats stored in the database is printed its
printed just in a textarea. I know its possible to list the data in a
listbox, but how do I get the right category selected for the movie I
choose?

You probably need to have some variant of:

SELECT NAME=category SIZE=5 MULTIPLE
OPTIONaction/OPTION
OPTIONcomedy/OPTION
OPTIONetc/OPTION
/SELECT

instead of whatever you have now.

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] RE: simple question

2002-04-03 Thread Tim Ward

Try http://www.idocs.com/tags/forms/ http://www.idocs.com/tags/forms/ 

Also (as the definitive reference for html) http://www.w3.org/MarkUp/
http://www.w3.org/MarkUp/ 

Once you've got html forms working okay, then the fields you've named in
your form are available as variables in the php page the form submits to
(the action property of the form tag, which can be the same page).

Tim Ward
Internet Chess www.chessish.com http://www.chessish.com 

--
From:  Denis L. Menezes [SMTP:[EMAIL PROTECTED]]
Sent:  02 April 2002 17:34
To:  [EMAIL PROTECTED]
Subject:  simple question

Hello friends.

I am able to add and query my database using php. I now wish to
build
webpages with textboxes and search the database with criteria from
the
textboxes.

Can someone tell me the resources for building these pages?

Thanks
Denis


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




[PHP] Re: Simple Question

2001-12-12 Thread Gaylen Fraley

strip_slashes()

--
Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com
PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite

Tom Ray [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have a quick question that I haven't been able to find the answer to
 yet. I've made a couple of guest books via PHP but the biggest problem
 I'm having is if any one inputs a ' or  or anything like that, the
 output in the book shows the stupid \ for the escape. So the word
 Tom's looks like Tom\'s Is there anyway for me to handle those
 characters so the backslash doesn't appear in the output?

 Thanks,
 Tom




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




Re: [PHP] Re: Simple Question

2001-12-12 Thread Tom Ray

oh no, Iv'e gotten two answers...

stripslashes() and strip_slashes()

which one? which one?! G

Gaylen Fraley wrote:

strip_slashes()

--
Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com
PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite

Tom Ray [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

I have a quick question that I haven't been able to find the answer to
yet. I've made a couple of guest books via PHP but the biggest problem
I'm having is if any one inputs a ' or  or anything like that, the
output in the book shows the stupid \ for the escape. So the word
Tom's looks like Tom\'s Is there anyway for me to handle those
characters so the backslash doesn't appear in the output?

Thanks,
Tom








RE: [PHP] Re: Simple Question

2001-12-12 Thread Martin Towell

Gaylen is prob right - I didn't check me syntax :(

-Original Message-
From: Tom Ray [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 13, 2001 3:11 PM
To: Gaylen Fraley
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Simple Question


oh no, Iv'e gotten two answers...

stripslashes() and strip_slashes()

which one? which one?! G

Gaylen Fraley wrote:

strip_slashes()

--
Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com
PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite

Tom Ray [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

I have a quick question that I haven't been able to find the answer to
yet. I've made a couple of guest books via PHP but the biggest problem
I'm having is if any one inputs a ' or  or anything like that, the
output in the book shows the stupid \ for the escape. So the word
Tom's looks like Tom\'s Is there anyway for me to handle those
characters so the backslash doesn't appear in the output?

Thanks,
Tom








Re: [PHP] Re: Simple Question

2001-12-12 Thread Rio Uniwaly

stripslashes() 

Rio :-)
- Original Message - 
From: Tom Ray [EMAIL PROTECTED]
To: Gaylen Fraley [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, December 13, 2001 11:10 AM
Subject: Re: [PHP] Re: Simple Question


 oh no, Iv'e gotten two answers...
 
 stripslashes() and strip_slashes()
 
 which one? which one?! G
 
 Gaylen Fraley wrote:
 
 strip_slashes()
 
 --
 Gaylen
 [EMAIL PROTECTED]
 Home http://www.gaylenandmargie.com
 PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite
 
 Tom Ray [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
 I have a quick question that I haven't been able to find the answer to
 yet. I've made a couple of guest books via PHP but the biggest problem
 I'm having is if any one inputs a ' or  or anything like that, the
 output in the book shows the stupid \ for the escape. So the word
 Tom's looks like Tom\'s Is there anyway for me to handle those
 characters so the backslash doesn't appear in the output?
 
 Thanks,
 Tom
 
 
 
 
 
 


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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




Re: [PHP] Re: Simple Question

2001-12-12 Thread Gaylen Fraley

Nope.  fatfingered :)  stripslashes() is correct!

--
Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com
PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite

Martin Towell [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Gaylen is prob right - I didn't check me syntax :(

 -Original Message-
 From: Tom Ray [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 13, 2001 3:11 PM
 To: Gaylen Fraley
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Re: Simple Question


 oh no, Iv'e gotten two answers...

 stripslashes() and strip_slashes()

 which one? which one?! G

 Gaylen Fraley wrote:

 strip_slashes()
 
 --
 Gaylen
 [EMAIL PROTECTED]
 Home http://www.gaylenandmargie.com
 PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite
 
 Tom Ray [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
 I have a quick question that I haven't been able to find the answer to
 yet. I've made a couple of guest books via PHP but the biggest problem
 I'm having is if any one inputs a ' or  or anything like that, the
 output in the book shows the stupid \ for the escape. So the word
 Tom's looks like Tom\'s Is there anyway for me to handle those
 characters so the backslash doesn't appear in the output?
 
 Thanks,
 Tom
 
 
 
 





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




RE: [PHP] Re: Simple Question

2001-12-12 Thread Martin Towell

you look at the docs or did you do it the trail-and-error way?

-Original Message-
From: Gaylen Fraley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 13, 2001 3:22 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Simple Question


Nope.  fatfingered :)  stripslashes() is correct!

--
Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com
PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite

Martin Towell [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Gaylen is prob right - I didn't check me syntax :(

 -Original Message-
 From: Tom Ray [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 13, 2001 3:11 PM
 To: Gaylen Fraley
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Re: Simple Question


 oh no, Iv'e gotten two answers...

 stripslashes() and strip_slashes()

 which one? which one?! G

 Gaylen Fraley wrote:

 strip_slashes()
 
 --
 Gaylen
 [EMAIL PROTECTED]
 Home http://www.gaylenandmargie.com
 PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite
 
 Tom Ray [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
 I have a quick question that I haven't been able to find the answer to
 yet. I've made a couple of guest books via PHP but the biggest problem
 I'm having is if any one inputs a ' or  or anything like that, the
 output in the book shows the stupid \ for the escape. So the word
 Tom's looks like Tom\'s Is there anyway for me to handle those
 characters so the backslash doesn't appear in the output?
 
 Thanks,
 Tom
 
 
 
 





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



Re: [PHP] Re: Simple Question

2001-12-12 Thread Gaylen

RE: [PHP] Re: Simple QuestionTo be honest, the book PHP4 Developer's Guide by Blake 
Schwendiman has it listed as strip_slashes().  I just happened to be reading it when I 
saw the original message and copied it as it's listed in the index.  So, rather than 
blaming him, I took the blame :).  I then grabbed the Docs and saw it didn't have the 
underscore.  Am I vindicated?

Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com
PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite

  - Original Message - 
  From: Martin Towell 
  To: 'Gaylen Fraley' ; [EMAIL PROTECTED] 
  Sent: Wednesday, December 12, 2001 10:56 PM
  Subject: RE: [PHP] Re: Simple Question


  you look at the docs or did you do it the trail-and-error way? 

  -Original Message- 
  From: Gaylen Fraley [mailto:[EMAIL PROTECTED]] 
  Sent: Thursday, December 13, 2001 3:22 PM 
  To: [EMAIL PROTECTED] 
  Subject: Re: [PHP] Re: Simple Question 



  Nope.  fatfingered :)  stripslashes() is correct! 

  -- 
  Gaylen 
  [EMAIL PROTECTED] 
  Home http://www.gaylenandmargie.com 
  PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite 

  Martin Towell [EMAIL PROTECTED] wrote in message 
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... 
   Gaylen is prob right - I didn't check me syntax :( 
   
   -Original Message- 
   From: Tom Ray [mailto:[EMAIL PROTECTED]] 
   Sent: Thursday, December 13, 2001 3:11 PM 
   To: Gaylen Fraley 
   Cc: [EMAIL PROTECTED] 
   Subject: Re: [PHP] Re: Simple Question 
   
   
   oh no, Iv'e gotten two answers... 
   
   stripslashes() and strip_slashes() 
   
   which one? which one?! G 
   
   Gaylen Fraley wrote: 
   
   strip_slashes() 

   -- 
   Gaylen 
   [EMAIL PROTECTED] 
   Home http://www.gaylenandmargie.com 
   PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite 

   Tom Ray [EMAIL PROTECTED] wrote in message 
   [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... 

   I have a quick question that I haven't been able to find the answer to 
   yet. I've made a couple of guest books via PHP but the biggest problem 
   I'm having is if any one inputs a ' or  or anything like that, the 
   output in the book shows the stupid \ for the escape. So the word 
   Tom's looks like Tom\'s Is there anyway for me to handle those 
   characters so the backslash doesn't appear in the output? 

   Thanks, 
   Tom 




   
   




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




RE: [PHP] Re: Simple Question

2001-12-12 Thread Martin Towell

it's just I would've gone ahead and tried one way to see if it gave me a
parse error - but then again, I like doing things the hard way... :)
 
-Original Message-
From: Gaylen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 13, 2001 4:05 PM
To: Martin Towell; [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Simple Question


To be honest, the book PHP4 Developer's Guide by Blake Schwendiman has it
listed as strip_slashes().  I just happened to be reading it when I saw the
original message and copied it as it's listed in the index.  So, rather than
blaming him, I took the blame :).  I then grabbed the Docs and saw it didn't
have the underscore.  Am I vindicated?
 
Gaylen
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
Home http://www.gaylenandmargie.com http://www.gaylenandmargie.com 
PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite
http://www.gaylenandmargie.com/phpwebsite 


- Original Message - 
From: Martin  mailto:[EMAIL PROTECTED] Towell 
To: 'Gaylen Fraley' mailto:[EMAIL PROTECTED]  ;
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]  
Sent: Wednesday, December 12, 2001 10:56 PM
Subject: RE: [PHP] Re: Simple Question


you look at the docs or did you do it the trail-and-error way? 

-Original Message- 
From: Gaylen Fraley [ mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] ] 
Sent: Thursday, December 13, 2001 3:22 PM 
To: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]  
Subject: Re: [PHP] Re: Simple Question 


Nope.  fatfingered :)  stripslashes() is correct! 

-- 
Gaylen 
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]  
Home http://www.gaylenandmargie.com http://www.gaylenandmargie.com  
PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite
http://www.gaylenandmargie.com/phpwebsite  

Martin Towell [EMAIL PROTECTED] wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]
[EMAIL PROTECTED]">news:[EMAIL PROTECTED] ... 
 Gaylen is prob right - I didn't check me syntax :( 
 
 -Original Message- 
 From: Tom Ray [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
] 
 Sent: Thursday, December 13, 2001 3:11 PM 
 To: Gaylen Fraley 
 Cc: [EMAIL PROTECTED] 
 Subject: Re: [PHP] Re: Simple Question 
 
 
 oh no, Iv'e gotten two answers... 
 
 stripslashes() and strip_slashes() 
 
 which one? which one?! G 
 
 Gaylen Fraley wrote: 
 
 strip_slashes() 
  
 -- 
 Gaylen 
 [EMAIL PROTECTED] 
 Home http://www.gaylenandmargie.com http://www.gaylenandmargie.com  
 PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite
http://www.gaylenandmargie.com/phpwebsite  
  
 Tom Ray [EMAIL PROTECTED] wrote in message 
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]
[EMAIL PROTECTED]">news:[EMAIL PROTECTED] ... 
  
 I have a quick question that I haven't been able to find the answer to 
 yet. I've made a couple of guest books via PHP but the biggest problem 
 I'm having is if any one inputs a ' or  or anything like that, the 
 output in the book shows the stupid \ for the escape. So the word 
 Tom's looks like Tom\'s Is there anyway for me to handle those 
 characters so the backslash doesn't appear in the output? 
  
 Thanks, 
 Tom 
  
  
  
  
 
 



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




Re: [PHP] Re: Simple Question

2001-12-12 Thread J.F.Kishor

hello,
I don't know how for I got your problem but, If you trying to
print a string like this

eg : print This is Tom's book;

In the above case you need not use a back slash to escape the single quote
coz' php accepts single quote's within a double quote.

Otherwise you can use stripslashes()

which works like this.
  
   string stripslashes(string str);

   Returns a string with backslashes stripped off. (\' becomes ' and so
   on.) Double backslashes are made into a single backslash.

regards
- JFK



 Tom Ray [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
 I have a quick question that I haven't been able to find the answer to
 yet. I've made a couple of guest books via PHP but the biggest problem
 I'm having is if any one inputs a ' or  or anything like that, the
 output in the book shows the stupid \ for the escape. So the word
 Tom's looks like Tom\'s Is there anyway for me to handle those
 characters so the backslash doesn't appear in the output?
 
 Thanks,
 Tom
 
 
 
 
 
 


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




[PHP] Re: Simple(?) Question

2001-12-05 Thread Chris Lee

do a header re-direct.

header(Location: http://domain.com/page.php;);

include any variables you want, inc session vars if needed.

--

  Chris Lee
  [EMAIL PROTECTED]


Andrew Forgue [EMAIL PROTECTED] wrote in message
001d01c17ddc$a898fc40$6701a8c0@ajf">news:001d01c17ddc$a898fc40$6701a8c0@ajf...
Hello,

Is there a way to post to a script without any user interventions... e.g
The user posts to a script, and the script posts back to the original one.

Thanks!




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




[PHP] Re: Simple Question: PHP, MySQL, HTML Form and NULL

2001-12-04 Thread Fred

Your form returns the date as an empty string  which is an invalid date.
MySQL sets all invalid dates to -00-00.  There is a big difference
between an empty string and NULL.  If you want to insert NULL into the MySQL
date field you will need to insert /0 which is the escape sequence for
NULL.

In the script that inserts the form data just add something like:
if ($Date == ) $Date = /0;
somewhere before the insert.

Fred

[EMAIL PROTECTED] wrote in message
BB6D932A42D6D211B4AC0090274EBB1DA0F139@GLOBAL1">news:BB6D932A42D6D211B4AC0090274EBB1DA0F139@GLOBAL1...
 I have added a new column in an existing MYSQL table called
event_date  -
 type: DATE, NULL default.

 This database field will be filled if and when the field in the HTML form
is
 complete.   When I added the new field to MySQL, it automatically assigned
 NULL to all the existing records - which is what I wanted it to do.

 I tested the HTML form, and when someone enters a date in the HTML form,
the
 date appears correctly in the table field.  Perfect.

 Now my question: When the HTML form date field is left blank  and the form
 is submitted, instead of putting NULL in the MySQL event_date field, I
 found: -00-00.  Is this because the form is submitting an   to the
 database field?

 Is there some kind of if/then statement I should use so that when the
field
 is empty,  NULL will be entered into that table field?

 Thank  you, Shawna



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




[PHP] Re: simple question...

2001-09-20 Thread Emile Bosch

Checkdate is the solution for that:
checkdate (int month, int day, int year)

Ker Ruben Ramos [EMAIL PROTECTED] schreef in berichtnieuws
00f801c14251$5aa288b0$[EMAIL PROTECTED]
 ey guys.. how do i check if the postdata is a valid time format? something
 like '2001-09-15'
 I hate it when they'll be entering garbage in it...




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