|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
News Script Tutorial Questions
Hey Guys,
I was doing the tutorial here on the site about News Script using PHP (btw, it rocks) And I was wondering why I can't have new lines/paragraphs in the <textarea> field. Thanks. |
|
#2
|
|||
|
|||
|
RE: News Script Tutorial Questions
You should be able to have newlines in the textarea. If you type them in, it will convert them to breaking returns so that it will display properly on an html page.
|
|
#3
|
|||
|
|||
|
RE: News Script Tutorial Questions
Oh yeah..
What I'm basically thinkin' is that when the script finds a match between the stuff in the .dat file and the username and password entered by the poster, it'll stop the foreach loop and go to print the news post on the news.txt file. But I don't know how to get out of the foreach loop |
|
#4
|
|||
|
|||
|
RE: News Script Tutorial Questions
You can use the break statement to get out of the foreach loop....
|
|
#5
|
|||
|
|||
|
RE: News Script Tutorial Questions
break statement?
|
|
#6
|
|||
|
|||
|
RE: News Script Tutorial Questions
w00t!
I found out the problem! check out the script here You'll have to register first http://members.lycos.co.uk/initialdrive/scripts/register.php http://members.lycos.co.uk/initialdrive/scripts/postnews.php Thanks to the tutorial on your site, I learned more about PHP! |
|
#7
|
|||||
|
|||||
|
RE: News Script Tutorial Questions
Hey guys, I found out how to use that break statement
But I still have a problem, when I enter the right values, it doesn't evalute it right. Here's a sample of my code and I also put comments on each line to specifically tell you what it does. php Code:
Basically, it doesn't print out either: "There is a match in the user database." or "You are not in the database." Even if I input the right values for the username and pass. |
|
#8
|
|||||
|
|||||
|
RE: News Script Tutorial Questions
Hey guys, I'm trying to modify some of the News Script tutorial to have users register first before posting news
What I basically did is make a register page for the user and the username and pass are entered into a .dat file What I'm trying to do is to see if the username and password that the poster entered matches any of the username (with the corresponding password) before he/she is allowed to post. But I'm stumped 'cause of the foreach function because it keeps looping for every line that's in the .dat file Is there a better way to evaluate the username and pass to see if they match? Here's some of the code that I've been workin' on. php Code:
|
|
#9
|
|||
|
|||
|
RE: News Script Tutorial Questions
Can you show me what the php-filke looks like now? What was the problemP
|
![]() |
| Viewing: Codewalkers Forums > Other > Tutorials > News Script Tutorial Questions |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|