[PHP-DB] RE: error

2004-09-28 Thread JeRRy
Suggestion, please note out where "line 9" is exactly.
 Some mail clients will use wordwrap and some not so
the lines may not be the same on "every" mail client
so "line 9" could be more like "line 14" on some and
"line 9" on others.  Just "//comment" where "line 9"
is so we know and can answer your question alot
better/easier/faster. :)

Otherwise we would have to test and find ourself. 
Which many of us don't have the time/patience for.

Jerry

-

From: [EMAIL PROTECTED] 
Date: Tue, 28 Sep 2004 06:58:10 EDT 
To: [EMAIL PROTECTED] 
Subject: error 

Dear friends,

Script writes to database, however gives this error
while on internet 
web 
server, on local host doesn't give same error.

Any guidance, please

Thank you
-
Back to Main 
Notice: Undefined index: op in 
\\premfs15\sites\premium15\mrbushforpeace\webroot\replytopost.php
on 
line 9
--

code of php script
--

Back to Main


   
   Post Your Reply in $topic_title
   
   
   Post Your Reply in $topic_title
   
   Your E-Mail Address:
   

   Post Text:
   

   
   

   

   
   
   ";
   }
} else if ($_POST["op"] == "addpost") {
   //check for required items from form
   if ((!$_POST["topic_id"]) || (!$_POST["post_text"])
|| 
(!$_POST["post_owner"])) {
   header("Location: topiclist.php");
   exit;
   }

   //add the post
   $add_post = "insert into forum_posts values ('',
'$_POST[topic_id]', 
'$_POST[post_text]', now(), '$_POST[post_owner]')";
   mysql_query($add_post,$conn) or die(mysql_error());

   //redirect user to topic

   exit;
}
?>



Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com

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



[PHP-DB] Was Convert plain text to HTML tagged text

2004-09-28 Thread veditio
Thanks to both Mike and Bastien for the quick solution. Simple, and works perfectly.

--V

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



RE: [PHP-DB] Convert plain text to HTML tagged text

2004-09-28 Thread Ford, Mike
On 28 September 2004 18:15, [EMAIL PROTECTED] wrote:

> To the list:
> 
> I've googled and searched the manual, but I'm still looking
> for a simple solution to a simple problem.
> 
> I have a MySQL database of text stories in longtext MySQL
> fields. These stories have simple returns (\r) in them and no
> other formatting. I need to use these stories both for web
> and print production, so I need to be able to get the text
> out of MySQL via PHP and have those returns change to 
> tags. But I also need to keep those extra  tags out of the
> database file so the text can be exported and poured into a
> layout program.
> 
> HTMLspecialchars and HTMLentities don't seem like the right
> solution, but maybe I'm missing something. Do I have to use
> regular expressions in PHP as the text is pulled from the database?

http://www.php.net/str_replace should be all you need -- no need for regexps for such 
a simple replace.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



RE: [PHP-DB] Convert plain text to HTML tagged text

2004-09-28 Thread Bastien Koert
why not do a search and replace on the way out to the browser?

$text = str_replace("\r,"",$text);
...
echo $text;
...
?>
bastien
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Convert plain text to HTML tagged text
Date: Tue, 28 Sep 2004 17:15:24 +
To the list:
I've googled and searched the manual, but I'm still looking for a simple 
solution to a simple problem.

I have a MySQL database of text stories in longtext MySQL fields. These 
stories have simple returns (\r) in them and no other formatting. I need to 
use these stories both for web and print production, so I need to be able 
to get the text out of MySQL via PHP and have those returns change to  
tags. But I also need to keep those extra  tags out of the database file 
so the text can be exported and poured into a layout program.

HTMLspecialchars and HTMLentities don't seem like the right solution, but 
maybe I'm missing something. Do I have to use regular expressions in PHP as 
the text is pulled from the database?

Thanks in advance for your help.
--veditio
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
Powerful Parental Controls Let your child discover the best the Internet has 
to offer. 
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines 
 Start enjoying all the benefits of MSNĀ® Premium right now and get the 
first two months FREE*.

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


[PHP-DB] Convert plain text to HTML tagged text

2004-09-28 Thread veditio
To the list:

I've googled and searched the manual, but I'm still looking for a simple solution to a 
simple problem.

I have a MySQL database of text stories in longtext MySQL fields. These stories have 
simple returns (\r) in them and no other formatting. I need to use these stories both 
for web and print production, so I need to be able to get the text out of MySQL via 
PHP and have those returns change to  tags. But I also need to keep those extra  
tags out of the database file so the text can be exported and poured into a layout 
program.

HTMLspecialchars and HTMLentities don't seem like the right solution, but maybe I'm 
missing something. Do I have to use regular expressions in PHP as the text is pulled 
from the database?

Thanks in advance for your help.

--veditio

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



Re: [PHP-DB] error

2004-09-28 Thread Janet Valade
[EMAIL PROTECTED] wrote:
Dear friends,
Script writes to database, however gives this error while on internet web 
server, on local host doesn't give same error.

Any guidance, please
Thank you
-
Back to Main 
Notice: Undefined index: op in 
\\premfs15\sites\premium15\mrbushforpeace\webroot\replytopost.php on line 9
--

code of php script
--

Back to Main


//connect to server and select database; we'll need it soon
$conn = mysql_connect("orf-mysql1.brinkster.com", "mrbushforpeace", 
"poilkjmnb") or die(mysql_error());
mysql_select_db("mrbushforpeace",$conn)  or die(mysql_error());

//check to see if we're showing the form or adding the post
if ($_POST["op"] != "addpost") {
   // showing the form; check for required item in query string
   if (!$_GET["post_id"]) {
header("Location: topiclist.php");
exit;
   }
The problem reported in the error message is that PHP can't find the 
specified element in an array. I assume that line 9 is probably your if 
line above, with $_POST["op"]. If so, the error means that PHP can't 
find the index "op" in $_POST. (You should be using single quotes here, 
e.g. $_POST['op']) This may or may not be a problem in your script.

The reason you see the error message on one machine and not on another 
is probably because the two machines are set at different error 
reporting levels. Check the values for error_reporting in your php.ini 
file. The condition is the same on both machines, whether the notice is 
displayed or not.

Whether or not the error is a problem depends on what your code is 
trying to do. You can eliminate the error message by checking whether 
the array element exists before using it (e.g., isset($_POST['op'])). Or 
you can just suppress the error message by putting a @ in front of the 
variable name.

Janet
--
Janet Valade -- janet.valade.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Question on Registration Method

2004-09-28 Thread Stuart Felenstein
Well, finally suceeding to get by activation page
working, where the 0 is flipped to 1 to mean actived,
I'm stuck on the login page.

Unfortunately I'm stuck :) with what I have below. 
It's part of an authentication system. This code
doesn't include the includes, but I thought maybe
significant enough to figure out where I can place a
line or two of code to throw an error on the
transaction if "active != 1"

Any ideas ?
Sorry if this is out of order.
Stuart 


//set the STARTER condition
$iLogin->registerTrigger(STARTER,'KT_TriggerSTARTER_Default',1,(isset($HTTP_POST_VARS['MM_Login'])
? $HTTP_POST_VARS['MM_Login'] : null));
//register the special Login Trigger
$iLogin->registerTrigger(AFTER,'KT_TriggerAFTER_LoginTrigger',1,'sessionvariable',(isset($HTTP_POST_VARS['RememberMe'])
? $HTTP_POST_VARS['RememberMe'] : null ));
// set the autogeneration information
$iLogin->generateSalt('xx');
$iLogin->setLoginTable('MemberTable');
$iLogin->passwordIsCryptedInDatabase(true);
$iLogin->setFields('MemberID','Username','password','level');
$iLogin->setValues((isset($HTTP_POST_VARS['username'])
? $HTTP_POST_VARS['username'] : null
),(isset($HTTP_POST_VARS['password']) ?
$HTTP_POST_VARS['password'] : null ));

// execute the transaction
$LurkerLogin->executeTransaction();

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



RE: [PHP-DB] error

2004-09-28 Thread Bastien Koert
try checking for the value
if (isset($_POST["op"] != "addpost")) {
or to supress the error, use the '@' symbol in fron of the $_POST or $_GET
if (@$_POST["op"] != "addpost") {
Bastien
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP-DB] error
Date: Tue, 28 Sep 2004 06:58:10 EDT
Dear friends,
Script writes to database, however gives this error while on internet web
server, on local host doesn't give same error.
Any guidance, please
Thank you
-
Back to Main
Notice: Undefined index: op in
\\premfs15\sites\premium15\mrbushforpeace\webroot\replytopost.php on line 9
--

code of php script
--

Back to Main

//check to see if we're showing the form or adding the post
if ($_POST["op"] != "addpost") {
   // showing the form; check for required item in query string
   if (!$_GET["post_id"]) {
header("Location: topiclist.php");
exit;
   }
   //still have to verify topic and post
   $verify = "select ft.topic_id, ft.topic_title from forum_posts as fp 
left
join forum_topics as ft on fp.topic_id = ft.topic_id where fp.post_id =
$_GET[post_id]";
   $verify_res = mysql_query($verify, $conn) or die(mysql_error());
   if (mysql_num_rows($verify_res) < 1) {
   //this post or topic does not exist
   header("Location: topiclist.php");
   exit;
   } else {
   //get the topic id and title
   $topic_id = mysql_result($verify_res,0,'topic_id');
   $topic_title = stripslashes(mysql_result($verify_res,
0,'topic_title'));

   print "
   
   
   Post Your Reply in $topic_title
   
   
   Post Your Reply in $topic_title
   
   Your E-Mail Address:
   
   Post Text:
   

   
   
   
   
   
   ";
   }
} else if ($_POST["op"] == "addpost") {
   //check for required items from form
   if ((!$_POST["topic_id"]) || (!$_POST["post_text"]) ||
(!$_POST["post_owner"])) {
   header("Location: topiclist.php");
   exit;
   }
   //add the post
   $add_post = "insert into forum_posts values ('', '$_POST[topic_id]',
'$_POST[post_text]', now(), '$_POST[post_owner]')";
   mysql_query($add_post,$conn) or die(mysql_error());
   //redirect user to topic
   exit;
}
?>
_
Don't just Search. Find! http://search.sympatico.msn.ca/default.aspx The new 
MSN Search! Check it out!

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


[PHP-DB] Re: error

2004-09-28 Thread David Robley
On Tue, 28 Sep 2004 20:28, [EMAIL PROTECTED] wrote:

> Dear friends,
> 
> Script writes to database, however gives this error while on internet web
> server, on local host doesn't give same error.
> 
> Any guidance, please
> 
> Thank you
> -
> Back to Main
> Notice: Undefined index: op in
> \\premfs15\sites\premium15\mrbushforpeace\webroot\replytopost.php on line
> 9

You probably have different error_reporting settings in the php.ini files on
the different servers. Test if the value is set.

-- 
David Robley

"I commanded a group of ships for a week," Tom said fleetingly.

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



[PHP-DB] error

2004-09-28 Thread Remember14a
Dear friends,

Script writes to database, however gives this error while on internet web 
server, on local host doesn't give same error.

Any guidance, please

Thank you
-
Back to Main 
Notice: Undefined index: op in 
\\premfs15\sites\premium15\mrbushforpeace\webroot\replytopost.php on line 9
--

code of php script
--

Back to Main


   
   Post Your Reply in $topic_title
   
   
   Post Your Reply in $topic_title
   
   Your E-Mail Address:
   

   Post Text:
   

   
   

   

   
   
   ";
   }
} else if ($_POST["op"] == "addpost") {
   //check for required items from form
   if ((!$_POST["topic_id"]) || (!$_POST["post_text"]) || 
(!$_POST["post_owner"])) {
   header("Location: topiclist.php");
   exit;
   }

   //add the post
   $add_post = "insert into forum_posts values ('', '$_POST[topic_id]', 
'$_POST[post_text]', now(), '$_POST[post_owner]')";
   mysql_query($add_post,$conn) or die(mysql_error());

   //redirect user to topic

   exit;
}
?>