Go to Post We should have a rule in CD, no sad booboo faces that make you want to cry... - JaneYoung [more]
Home
Go Back   Chief Delphi > Technical > IT / Communications > Website Design/Showcase
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 22-05-2004, 16:05
Raven_Writer's Avatar
Raven_Writer Raven_Writer is offline
2004 Detroit & Pittsburgh Winners
AKA: Eric Hansen
FRC #0005 (RoboCards)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Melvindale
Posts: 1,549
Raven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really nice
Send a message via ICQ to Raven_Writer Send a message via AIM to Raven_Writer Send a message via MSN to Raven_Writer Send a message via Yahoo to Raven_Writer
PHP Question

While trying to get back in the swing of things (again) w/ PHP, I decided to make a lil' poetry script. Basically, you type in some info, and then it sends you to a page asking if the information is correct, then it saves it as a file.

My problem is in the checking to see if the poem is correct. I can't show the poem. Currently, what I'm doing is:

PHP Code:
$poem = $_POST['poem'];
 
<?if($poem == ""){
 echo(
"no poem");
}else{
 
$show explode("  "$poem);
 echo(
"$show");
}
?>
The thing that is displayed (when there's a poem), is "Array" (w/o quotes). I have looked at the PHP document on this, and couldn't find really anything. Does anyone know how to fix this? (If I don't use explode, and just show the poem, it displays the newline characters as double-spaces).
__________________
AIM: wisprmylastbreth
EMail: nightskywriter@gmail.com
Y!: synsoflife

"ai yoru ga" -- "Love the nights"
  #2   Spotlight this post!  
Unread 22-05-2004, 18:19
Guest
 
Posts: n/a
Re: PHP Question

This should work.

You can't "echo" an array. nl2br converts all new lines into HTML <BR> tags.

Correct code:
PHP Code:
$poem = $_POST['poem'];
 
<?if($poem == ""){
echo(
"no poem");
}else{
$show nl2br($poem);
echo(
"$show");
}
?>
  #3   Spotlight this post!  
Unread 22-05-2004, 18:42
Raven_Writer's Avatar
Raven_Writer Raven_Writer is offline
2004 Detroit & Pittsburgh Winners
AKA: Eric Hansen
FRC #0005 (RoboCards)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Melvindale
Posts: 1,549
Raven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really nice
Send a message via ICQ to Raven_Writer Send a message via AIM to Raven_Writer Send a message via MSN to Raven_Writer Send a message via Yahoo to Raven_Writer
Re: PHP Question

Thank you. Apperantly, I had to refresh more than once. It works now....thanks again much.
__________________
AIM: wisprmylastbreth
EMail: nightskywriter@gmail.com
Y!: synsoflife

"ai yoru ga" -- "Love the nights"

Last edited by Raven_Writer : 22-05-2004 at 18:45. Reason: SilverStar gave me the answer
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question of the Week [05-02-04]: The Very Merry Month of May EddieMcD Rumor Mill 10 05-05-2004 14:02
A question about control system options computhief263 Control System 7 04-02-2004 14:46
php vs. perl Jack Website Design/Showcase 20 29-12-2002 17:01
What's better, PERL/cgi or PHP/my_sql? mikefrei Programming 10 27-05-2002 22:50


All times are GMT -5. The time now is 01:52.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi