RE: [PHP] question about forum
have a look at other people's codes. you can start by looking at my forum, which is pretty simple to install and work with : http://www.wde.org/me/php/ /sunny -Original Message- From: Jason Wang [mailto:[EMAIL PROTECTED]] Sent: 23 July 2001 08:06 To: [EMAIL PROTECTED] Subject: [PHP] question about forum Dear all, I want to set up an online forum by using PHP. But I don't have a clue. Could somebody kind enough tell me where to start? thanks in advance. -- 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 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] mail with html
here's a script i wrote a while back. copied and pasted. - ? if ($submit) { $headers .= From: $myemail \n; $headers .= cc:$cc \n; $headers .= bcc:$bcc \n; // $headers .= Content-Type: text/html; charset=iso-8859-1\n; $message = stripslashes($contents); header(Location:http://www.wde.org/me/;); mail($to, $subject, $message, $headers); } else { echo html; $myemail1 = nothing [EMAIL PROTECTED]; echo brform action=\$php_self\ method=\post\ table cellpadding=15 cellspacing=0 width=100% bgcolor=#ff tr td align=rightstrong class=blackfrom which account :/strong/td tdselect name=\myemail\ option value=\$myemail1\[EMAIL PROTECTED] /select /td /tr tr td align=rightstrong class=blackemail to :/strong/td tdinput type=text name=\to\/td /tr tr td align=rightstrong class=blackcopy to :/strong/td tdinput type=text name=\cc\/td /tr tr td align=rightstrong class=blackblind copy to :/strong/td tdinput type=text name=\bcc\/td /tr tr td align=rightstrong class=blacksubject :/strong/td tdinput type=text name=\subject\/td /tr tr td valign=top align=rightstrong class=blackemail message :/strong/td tdtextarea cols=45 rows=15 name=\contents\ wrap=physical/textarea/td /tr tr tdnbsp;/td tdstrong class=blackinput type=submit name=submit value=\send this email\/strong/td /tr /table /form; } ? - that should work as a page in itself let me know if you have problems /sunny -Original Message- From: Adrian D'Costa [mailto:[EMAIL PROTECTED]] Sent: 23 July 2001 11:09 To: php general list Subject: [PHP] mail with html Hi, I know this subject had been discussed here before. Tried searching in list.php.net, I get a message search not setup (or something). I want to send html mails thru php using mail(). Could someone tell me where I can study some scripts or tutorials. TIA Adrian -- 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 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] mail with html
oh yeah, you might want to tidy up the code a bit... the email has put in line breaks. and replace [EMAIL PROTECTED] with your own email... the mail() command does all the work... the header command redirects the page.. you might want to change the address or remove it. /sunny -Original Message- From: Sandeep Hundal [mailto:[EMAIL PROTECTED]] Sent: 23 July 2001 11:06 To: 'Adrian D'Costa'; php general list Subject: RE: [PHP] mail with html here's a script i wrote a while back. copied and pasted. - ? if ($submit) { $headers .= From: $myemail \n; $headers .= cc:$cc \n; $headers .= bcc:$bcc \n; // $headers .= Content-Type: text/html; charset=iso-8859-1\n; $message = stripslashes($contents); header(Location:http://www.wde.org/me/;); mail($to, $subject, $message, $headers); } else { echo html; $myemail1 = nothing [EMAIL PROTECTED]; echo brform action=\$php_self\ method=\post\ table cellpadding=15 cellspacing=0 width=100% bgcolor=#ff tr td align=rightstrong class=blackfrom which account :/strong/td tdselect name=\myemail\ option value=\$myemail1\[EMAIL PROTECTED] /select /td /tr tr td align=rightstrong class=blackemail to :/strong/td tdinput type=text name=\to\/td /tr tr td align=rightstrong class=blackcopy to :/strong/td tdinput type=text name=\cc\/td /tr tr td align=rightstrong class=blackblind copy to :/strong/td tdinput type=text name=\bcc\/td /tr tr td align=rightstrong class=blacksubject :/strong/td tdinput type=text name=\subject\/td /tr tr td valign=top align=rightstrong class=blackemail message :/strong/td tdtextarea cols=45 rows=15 name=\contents\ wrap=physical/textarea/td /tr tr tdnbsp;/td tdstrong class=blackinput type=submit name=submit value=\send this email\/strong/td /tr /table /form; } ? - that should work as a page in itself let me know if you have problems /sunny -Original Message- From: Adrian D'Costa [mailto:[EMAIL PROTECTED]] Sent: 23 July 2001 11:09 To: php general list Subject: [PHP] mail with html Hi, I know this subject had been discussed here before. Tried searching in list.php.net, I get a message search not setup (or something). I want to send html mails thru php using mail(). Could someone tell me where I can study some scripts or tutorials. TIA Adrian -- 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 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 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] mail with html
well all you need to do is use part of the script i sent you.. and in the header variable, uncomment the bit which says text/html and then you can send html email instead of text email... i'm assuming you've already written the script to sent plain text email. i thought you needed that. /sunny -Original Message- From: Adrian D'Costa [mailto:[EMAIL PROTECTED]] Sent: 23 July 2001 12:26 To: Sandeep Hundal Cc: php general list Subject: RE: [PHP] mail with html Hi Sandeep, Thanks for your mail but I was looking at something else. This is what I need. I have a table that I will be selecting certian records and mailing to clients that have signed up. The result should be in html and plain text. The plain text is working now but I want to put into a table format to look neater, below is a sample in text format. Any clues? Destinazione Periodo Vitofferte London 2001-07-31 Chf 385 Hammamet2001-07-28 Chf 999 Adrian On Mon, 23 Jul 2001, Sandeep Hundal wrote: oh yeah, you might want to tidy up the code a bit... the email has put in line breaks. and replace [EMAIL PROTECTED] with your own email... the mail() command does all the work... the header command redirects the page.. you might want to change the address or remove it. /sunny -Original Message- From: Sandeep Hundal [mailto:[EMAIL PROTECTED]] Sent: 23 July 2001 11:06 To: 'Adrian D'Costa'; php general list Subject: RE: [PHP] mail with html here's a script i wrote a while back. copied and pasted. - ? if ($submit) { $headers .= From: $myemail \n; $headers .= cc:$cc \n; $headers .= bcc:$bcc \n; // $headers .= Content-Type: text/html; charset=iso-8859-1\n; $message = stripslashes($contents); header(Location:http://www.wde.org/me/;); mail($to, $subject, $message, $headers); } else { echo html; $myemail1 = nothing [EMAIL PROTECTED]; echo brform action=\$php_self\ method=\post\ table cellpadding=15 cellspacing=0 width=100% bgcolor=#ff tr td align=rightstrong class=blackfrom which account :/strong/td tdselect name=\myemail\ option value=\$myemail1\[EMAIL PROTECTED] /select /td /tr tr td align=rightstrong class=blackemail to :/strong/td tdinput type=text name=\to\/td /tr tr td align=rightstrong class=blackcopy to :/strong/td tdinput type=text name=\cc\/td /tr tr td align=rightstrong class=blackblind copy to :/strong/td tdinput type=text name=\bcc\/td /tr tr td align=rightstrong class=blacksubject :/strong/td tdinput type=text name=\subject\/td /tr tr td valign=top align=rightstrong class=blackemail message :/strong/td tdtextarea cols=45 rows=15 name=\contents\ wrap=physical/textarea/td /tr tr tdnbsp;/td tdstrong class=blackinput type=submit name=submit value=\send this email\/strong/td /tr /table /form; } ? - that should work as a page in itself let me know if you have problems /sunny -Original Message- From: Adrian D'Costa [mailto:[EMAIL PROTECTED]] Sent: 23 July 2001 11:09 To: php general list Subject: [PHP] mail with html Hi, I know this subject had been discussed here before. Tried searching in list.php.net, I get a message search not setup (or something). I want to send html mails thru php using mail(). Could someone tell me where I can study some scripts or tutorials. TIA Adrian -- 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] mail with html
you don't. as far as I know, you just put the code in the message like such : $message = table tr td$name/tdtdareacode/td /tr /table ; and then send off $message using mail(). You might want to stripslashes() as I did. /sunny -Original Message- From: Adrian D'Costa [mailto:[EMAIL PROTECTED]] Sent: 23 July 2001 13:04 To: Sandeep Hundal Cc: php general list Subject: RE: [PHP] mail with html The question is how do I declare the html coding in the message part. Any samples Adrian On Mon, 23 Jul 2001, Sandeep Hundal wrote: well all you need to do is use part of the script i sent you.. and in the header variable, uncomment the bit which says text/html and then you can send html email instead of text email... i'm assuming you've already written the script to sent plain text email. i thought you needed that. /sunny -Original Message- From: Adrian D'Costa [mailto:[EMAIL PROTECTED]] Sent: 23 July 2001 12:26 To: Sandeep Hundal Cc: php general list Subject: RE: [PHP] mail with html Hi Sandeep, Thanks for your mail but I was looking at something else. This is what I need. I have a table that I will be selecting certian records and mailing to clients that have signed up. The result should be in html and plain text. The plain text is working now but I want to put into a table format to look neater, below is a sample in text format. Any clues? Destinazione Periodo Vitofferte London 2001-07-31 Chf 385 Hammamet2001-07-28 Chf 999 Adrian On Mon, 23 Jul 2001, Sandeep Hundal wrote: oh yeah, you might want to tidy up the code a bit... the email has put in line breaks. and replace [EMAIL PROTECTED] with your own email... the mail() command does all the work... the header command redirects the page.. you might want to change the address or remove it. /sunny -Original Message- From: Sandeep Hundal [mailto:[EMAIL PROTECTED]] Sent: 23 July 2001 11:06 To: 'Adrian D'Costa'; php general list Subject: RE: [PHP] mail with html here's a script i wrote a while back. copied and pasted. - ? if ($submit) { $headers .= From: $myemail \n; $headers .= cc:$cc \n; $headers .= bcc:$bcc \n; // $headers .= Content-Type: text/html; charset=iso-8859-1\n; $message = stripslashes($contents); header(Location:http://www.wde.org/me/;); mail($to, $subject, $message, $headers); } else { echo html; $myemail1 = nothing [EMAIL PROTECTED]; echo brform action=\$php_self\ method=\post\ table cellpadding=15 cellspacing=0 width=100% bgcolor=#ff tr td align=rightstrong class=blackfrom which account :/strong/td tdselect name=\myemail\ option value=\$myemail1\[EMAIL PROTECTED] /select /td /tr tr td align=rightstrong class=blackemail to :/strong/td tdinput type=text name=\to\/td /tr tr td align=rightstrong class=blackcopy to :/strong/td tdinput type=text name=\cc\/td /tr tr td align=rightstrong class=blackblind copy to :/strong/td tdinput type=text name=\bcc\/td /tr tr td align=rightstrong class=blacksubject :/strong/td tdinput type=text name=\subject\/td /tr tr td valign=top align=rightstrong class=blackemail message :/strong/td tdtextarea cols=45 rows=15 name=\contents\ wrap=physical/textarea/td /tr tr tdnbsp;/td tdstrong class=blackinput type=submit name=submit value=\send this email\/strong/td /tr /table /form; } ? - that should work as a page in itself let me know if you have problems /sunny -Original Message- From: Adrian D'Costa [mailto:[EMAIL PROTECTED
[PHP] checking to see if part of a variable exists?
hi all! i need to see if a $variable has a piece of text included in it. how do i do that? i need to do something like: if ($variable =matches= @monkeys.com) { then do this} tia! -- 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] if $submit
i always use such statements like : if ($submit) { then do this } else { render the page } and it works fine... -Original Message- From: Tarrant Costelloe [mailto:[EMAIL PROTECTED]] Sent: 21 May 2001 15:16 To: Php (E-mail) Subject: [PHP] if $submit Whenever I use the ? if ($submit) ? statement in a php page it always comes up with: Warning: Undefined variable Until the submit has been hit, and then it continue on with the rest of the script fine ( ifelse). How do you stop this warning message? Thanks in advance! Tarrant Costelloe Web Developer InsurE-com Ltd. Office Tel: +44 (0)1273 852014 Mobile: +44 07714087114 [EMAIL PROTECTED] http://www.insur-e.net -- 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 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] Problem with outputting date and time
what you could do is something like get the unix time, and add an hour to that, and then use the date function to output the date. $today = (time() + 3600); $output = date(F jS Y, h:ia, $today); hope that helps! /sunny -Original Message- From: Good Fella [mailto:[EMAIL PROTECTED]] Sent: 17 May 2001 12:18 To: [EMAIL PROTECTED] Subject: [PHP] Problem with outputting date and time Hi All, I need help with a small problem. My website has many users from around the world, and they need to submit a form at a certain time (UK Time). Because of this, I need to display the UK Time on my website. I do this by putting this code: ?php echo gmdate(F jS Y, h:ia); ? There is nothing wrong with this code, except for when the clock changes (goes back/forward an hour). This means that this code is 1 hour behind the real UK Time at the moment. Is there any simple way of adding 1 hour onto this? It's extremely confusing as it's making users from around the globe late with their submissions. Thanks for your help and time SK _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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] -- 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: WELCOME to php-general@lists.php.net
have a look at : http://www.hotscripts.com/PHP/ and www.devshed.com and zend.com sunny -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 15 May 2001 14:45 To: [EMAIL PROTECTED] Subject: [PHP] Re: WELCOME to [EMAIL PROTECTED] Dear sir, I am new to php.kindly recommend me tutorials tp get started. thanks asif -- 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 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] validate form with javascript
doh! forgot to add, you need to put this in your form tage as well : name=formname onSubmit=return formCheck() regards /sunny -Original Message- From: Sandeep Hundal [mailto:[EMAIL PROTECTED]] Sent: 14 May 2001 10:43 To: 'Meir Kriheli - MKsoft'; Chris Mason; [EMAIL PROTECTED] Subject: RE: [PHP] validate form with javascript here's one that i use along with my forms you can ofcourse expand it to include all forms as long as you change the input names too hapy coding :) /sunny script language=JavaScript transmitted = 0; function formCheck() { if (document.formname.inputname.value == ) { alert(You need to enter an email address!); document.formname.inputname.focus(); return false; } } /script -Original Message- From: Meir Kriheli - MKsoft [mailto:[EMAIL PROTECTED]] Sent: 14 May 2001 11:42 To: Chris Mason; [EMAIL PROTECTED] Subject: Re: [PHP] validate form with javascript You can try the forms class from Manuel Lemos, which handles this and more. For more details: http://phpclasses.upperdesign.com/browse.html/package/1 -- Meir Kriheli MKsoft computer systems 'There's someone in my head but it's not me - Pink Floyd - Original Message - From: Chris Mason [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 14, 2001 2:46 AM Subject: [PHP] validate form with javascript I have a form in which I validate the email address using a php function then alert the operson if the email address is not correct. However, I would like to pop up an alert with javascript if the email field is left blank. I am using the function below but it down't work with php, probably works great with a cgi. Does anyone have a better way to do this? Chris Mason Code: in the head function validForm(replyForm) { if(replyForm.email.value==\\){ alert(\You must enter an email address\) replyform.email.value.focus() return false } return true } in the form: FORM onSubmit=\return validForm(this)\ METHOD=\POST\ ACTION=\reserve.php3?action=send\ ENCTYPE=\x-www-form-urlencoded\ table TR CLASS=\$c\ TD CLASS=\$c\E-Mail /TD TD COLSPAN=\$i\INPUT TYPE=\text\ NAME=\email\ VALUE=\$email\ SIZE=\50\/TD/TR /table /form ) -- 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 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 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] my query results won't clear!! :(
damn, yeah thats my problem. how do i clear out all variables then?? thanks! /sunny -Original Message- From: Mark Roedel [mailto:[EMAIL PROTECTED]] Sent: 14 May 2001 14:56 To: Sandeep Hundal; [EMAIL PROTECTED] Subject: RE: [PHP] my query results won't clear!! :( -Original Message- From: Sandeep Hundal [mailto:[EMAIL PROTECTED]] Sent: Monday, May 14, 2001 3:21 AM To: [EMAIL PROTECTED] Subject: [PHP] my query results won't clear!! :( i'm running a select query on a table, and ihave a form right underneath it, with similar names to the information selected in the query above. yet despite using mysql_free_results before my form starts, it still keeps the last result of the query 1 in memory :( are there any solutions?? It's hard to be certain of much without seeing any of your code. My guess, though, would be that you're simply misunderstanding the extent to which mysql_free_result() operates. In particular, it only frees the memory associated with the result set itself. It does not clear out variables that you've assigned to hold pieces of the returned data. That is, given the following code: $result = mysql_query('select * from table'); $mydata = mysql_fetch_array($mydata); mysql_free_result($result); $result should be cleared out. $mydata, however, should be retained. Does that match what you're experiencing? --- Mark Roedel ([EMAIL PROTECTED]) || There cannot be a crisis next week. Systems Programmer / WebMaster || My schedule is already full. LeTourneau University ||-- Henry Kissinger -- 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 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] achive style message center
why not just use a message board? -Original Message- From: shaun [mailto:[EMAIL PROTECTED]] Sent: 14 May 2001 18:15 To: [EMAIL PROTECTED] Subject: [PHP] achive style message center i was wondering if anyone has or knows were i can find an archive style message system much like the php support archive. im looking for something to create a forum were people can chat and interact without the need of real time preferably the archive should be searchable if anyone could help i would be very appreciative. if you need more information just ask -- 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 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] bulletin board or forum
there's a simple and free one i'm releasing very soon from my homepage : http://www.wde.org/me/php/ its got a working example too. /sunny --- Kian On [EMAIL PROTECTED] wrote: Hi, Does anyone know a FREE forum or bulletin board that written in PHP? Please give the name or URL. I would like to download and try it out... Thanks! Yong -- 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] Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie -- 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] i need some help with extracting data from mysql
hi all, i've got a simple problem, yet it doesn't work, so i hope someone can help me out here. i've got a table with id, group, and name. each group has many names ofcourse. now i need to output the data like : group1 name1 name2 name3 group2 name4 name5 group3 name6 etc my query is SELECT group, name FROM $tablename WHERE approved='yes' GROUP BY folder ORDER BY folder; yet the ouput can't seem to handle more than 1 name per group. any ideas?? thanks in advance! /sunny Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie -- 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] Forms and PHP_SELF
surely all you need to do is put the php right at the top, and say if (isset($variable) { print this message } else {do this header (); } i've done that loads of times so the form data goes back to the page, and once its inserted into the db, it sends a header to redirect. /sunny -Original Message- From: Chad Guilette [mailto:[EMAIL PROTECTED]] Sent: 10 May 2001 16:07 To: [EMAIL PROTECTED] Subject: [PHP] Forms and PHP_SELF I'm currently working on a project and I've come across a problem which I'm sure has been discussed several times before but I still need some assistance on it. I have a page with a form whose action is $PHP_SELF so the form and the form action are all in the same pagethis works fine but in the form action a message is displayed stating success or failure of the insertion of data into a database and the user is redirected by means of a meta refershduring this time if the user refreshes the page the data is resubmitted againthe user can do this repeatedly Some people have suggested that I use headers but I cannot do this at this point because I've already sent the header... others have suggested I use some variable $script_ran_count = 1 then run and after increment so a test of it would be false...this had no effect others have suggested javascript... I'm really baffled...how can I have a self-submitting form page that has a display message and a meta redirect but if the user refreshes the page stop the resumission of data? Regards, Chad Guilette -- 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 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] i need some help with extracting data from mysql desperately!!
unfortunately, that doesn't seem to work either. it basically only gives me on name per group. here's my php: $query = SELECT * FROM $tablename WHERE approved='yes' GROUP BY group ORDER BY group, name; $result2 = mysql_query($query2); if ($result2) { while ($r2 = mysql_fetch_array($result2)) { extract($r2); echo strong$folder/strongbr nbsp;nbsp;$name br; } } all it does is print out one name per group, and if there is more than one name in a group, it comes up sperately (but the group name goes missing). basically i need this: group1 name1 name2 name3 group2 name4 name5 thanks for any help, i'm sure this is something really straightforward, but i can't put my finger to it tia! /sunny -Original Message- From: bill [mailto:[EMAIL PROTECTED]] Sent: 10 May 2001 14:58 To: [EMAIL PROTECTED] Subject: Re: [PHP] i need some help with extracting data from mysql Sandeep, Try: $sql=SELECT group, name FROM $tablename WHERE approved='yes' ORDER BY group, name; Don't know what fieldname folder is in your original SQL. You said that the table had only id, group, name. But I note that you must also have a fieldname called approved. In any case, assuming the fieldnames are correct, the above should work. kind regards, bill hollett -- 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] i need some help with extracting data from mysql desperately!!
doh! i just realised the difference in $query number, but thats not an issue in the actual code, i just cleaned that up a bit /sunny -Original Message- From: Sandeep Hundal [mailto:[EMAIL PROTECTED]] Sent: 10 May 2001 16:49 To: 'bill'; [EMAIL PROTECTED] Subject: [PHP] i need some help with extracting data from mysql desperately!! unfortunately, that doesn't seem to work either. it basically only gives me on name per group. here's my php: $query = SELECT * FROM $tablename WHERE approved='yes' GROUP BY group ORDER BY group, name; $result2 = mysql_query($query2); if ($result2) { while ($r2 = mysql_fetch_array($result2)) { extract($r2); echo strong$folder/strongbr nbsp;nbsp;$name br; } } all it does is print out one name per group, and if there is more than one name in a group, it comes up sperately (but the group name goes missing). basically i need this: group1 name1 name2 name3 group2 name4 name5 thanks for any help, i'm sure this is something really straightforward, but i can't put my finger to it tia! /sunny -Original Message- From: bill [mailto:[EMAIL PROTECTED]] Sent: 10 May 2001 14:58 To: [EMAIL PROTECTED] Subject: Re: [PHP] i need some help with extracting data from mysql Sandeep, Try: $sql=SELECT group, name FROM $tablename WHERE approved='yes' ORDER BY group, name; Don't know what fieldname folder is in your original SQL. You said that the table had only id, group, name. But I note that you must also have a fieldname called approved. In any case, assuming the fieldnames are correct, the above should work. kind regards, bill hollett -- 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 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] i need some help with extracting data from mysql
-Original Message- From: Steve Werby [mailto:[EMAIL PROTECTED]] Sent: 10 May 2001 17:04 To: Sandeep Hundal; php Subject: Re: [PHP] i need some help with extracting data from mysql Sandeep Hundal [EMAIL PROTECTED] wrote: i've got a simple problem, yet it doesn't work, so i hope someone can help me out here. i've got a table with id, group, and name. each group has many names ofcourse. Are these *all* of the field names? Sorry, some typo errors, i got confused. The field names are : id, group, name, approved. now i need to output the data like : group1 name1 name2 name3 group2 name4 name5 group3 name6 etc my query is SELECT group, name FROM $tablename WHERE approved='yes' GROUP BY folder ORDER BY folder; Sorry, substitute folder for Group. I just wrote that by mistake. Data is such: 1 | friends | name1 | yes 2 | misc| name2 | yes 3 | friends | name3 | yes 4 | work| name4 | no I want to extract the ones approves, but list them by Group first, and all the relevant names after. But I dont want to run a query for each GROUP to output the data underneath it. TIA /sunny -- 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] simple database extraction problem :(
hi all! just a quick thing. i've got loads of info in mysql, which i extract and then use a while ($r = mysql_fetch_array($result)) { to output the result. the only thing is, because its a loop, all results look the same, whereas i want the first row to be displayed differently than the next 4. any clues?? thanks! /sunny Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie -- 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] simple querying mysql in a WML card problem :(
hi all! i'm trying to get simple 2 line results from mysql in a wml card, but i can't seem to manage it. here's my code: ? header(Content-type: text/vnd.wap.wml); header(Cache-Control: no-cache, must-revalidate); header(Pragma: no-cache); echo (?xml version='1.0'?); ? !DOCTYPE wml PUBLIC -//WAPFORUM//DTD WML 1.1//EN http://www.wapforum.org/DTD/wml_1.1.xml;; ? include (db.php); $query1 = SELECT club FROM table WHERE day='monday' ; echo wml card id=card1 title=clubbing by day p; $result1 = mysql_query($query1); if ($result1) { echo $day br; while ($r1 = mysql_fetch_array($result1)) { extract($r1); echo $clubdetails br; } } mysql_free_result($result1); echo /p /card /wml; ? simple? yet all it seems to give m is : ; = mysql_query( if ( { echo ; while ( = mysql_fetch_array( { extract( echo ; } }mysql_free_result( - in my emulator (WinWAP). Any help greatly appreciated! /sandeep Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie -- 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] Easy News Script
i wrote one a few months back, and use it as a diary. the enhanced one out for release soon will look more like the slashdot system, but much easier. http://www.wde.org/php/ /sunny --- Chris Anderson [EMAIL PROTECTED] wrote: I prefer to write my own - Original Message - From: "Zeus" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 12, 2001 10:11 AM Subject: [PHP] Easy News Script I'm sure many of you heard of newsphp ? (the newspro-clone). Somehow I felt attached to it except that it doesn't use databases for its file storing. Does anyone know a good similar script (easy to setup) that uses mySQL? -- 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] Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie -- 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] a quick date and session id question
Hi all, I got two small questions. I'm trying to make an events calendar for my site, in which I want people to input in future dates, and then have the database display events by date. NOw they will probably be given a form which allows them to choose, and then gets inputted into the datase as a number : MMDD. But I want to display the data as "Monday, 20 April 2001. How can I do this? Or should I change the way I input data?? Secondly, Anyone know fof a good tutorial explaining what sessionid's in php are for and how to use them?? TIA! /sunny Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie -- 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] a simple diary / news system for download
hi all, just wanted to say thanks to everyone for helping me out with my php enquires over the last few months. in the general free spirit ofcourse, i'm going to try and make all the code that i write available for free download. anyway, for starters, i've made a simple diary / news system on my homepage available for download. its damn simple to install and work with, and needs mysql. it can also be used as a script for learning on inputting and retrieving info from the mysql database. http://www.wde.org/me/php/ cheers!! /sunny __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.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]
[PHP] how to use php and xsl to transform xml to html?
ihi all, i was reading somewhere on how ASP uses microsoft's xml engine to transform xml documents which have accompanying xsl stylesheets. basically what i would like to do is write an xml document, write an accompanying xsl sheet, and then run a php script on the web so that an html file is produced from my xml file, which i can point to? does that make sense? can that be done?? thanks! /sunny __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.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]
[PHP] how can i extract from such an array??
hi all, just a quick question. i've made a personal addressbook, the code for which i'm going to release soon (best probably for newbies). anyway, i want to make it so that i can pass multiple email address from one page to another. basically it'll be a form select function like : select name="$emailto[]"; option name="email1"name1 option name="email2"name2 option name="email3"name3 option name="email4"name4 /select now say i select name 1 and 4. i want to extract the emails on the page the variables are passed to, seperated by a comma. any piece of code?? thanks! /sunny __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.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] Super SQL problem! Please advise!
Thanks a lot for your help everyone!!! It worked!! Woohoo!! Not only that, I learned about joins! :) /sunny --- Steve Werby [EMAIL PROTECTED] wrote: "Sandeep Hundal" [EMAIL PROTECTED] wrote: thanks for the tip steve. i read up on left joins, and got this: SELECT diary.id, diary.thedate, diary.topic, diary.entry FROM diary LEFT JOIN comments ON diary.id = comments.id; but it only joins the two tables. Right. It took care of your main problem though. What I need is only 1 column from the second table, counted. Something like this, but that doesn't work :( SELECT diary.id, diary.thedate, diary.topic, diary.entry FROM diary LEFT JOIN comments.id ON diary.id = comments.id COUNT(comments.id) GROUP BY comments.id; The order of your statement is a little off. Try this: SELECT diary.id, diary.thedate, diary.topic, diary.entry, COUNT(comments.id) FROM diary LEFT JOIN comments.id ON diary.id = comments.id GROUP BY comments.id; If that doesn't work you might want to look at running two queries and saving their results as temporary tables and then running a query to join the two temporary tables to get what you want. Also, for SQL questions like this you'll get better [or more or quicker] responses on the mysql mailing list. Sign up at www.mysql.com. -- Steve Werby COO 24-7 Computer Services, LLC Tel: 804.817.2470 http://www.247computing.com/ __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.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] Super SQL problem! Please advise!
thanks for the tip steve. i read up on left joins, and got this: SELECT diary.id, diary.thedate, diary.topic, diary.entry FROM diary LEFT JOIN comments ON diary.id = comments.id; but it only joins the two tables. What I need is only 1 column from the second table, counted. Something like this, but that doesn't work :( SELECT diary.id, diary.thedate, diary.topic, diary.entry FROM diary LEFT JOIN comments.id ON diary.id = comments.id COUNT(comments.id) GROUP BY comments.id; Any ideas how that could work?? Thanks all /sunny diary.month='$month' AND diary.id = comments.id GROUP BY comments.id ORDER BY diary.id DESC " --- Steve Werby [EMAIL PROTECTED] wrote: "Sandeep Hundal" [EMAIL PROTECTED] wrote: SELECT diary.id, diary.thedate, diary.topic, diary.entry, count(comments.id) AS comments FROM diary, comments WHERE diary.month='$month' AND diary.id = comments.id GROUP BY comments.id ORDER BY diary.id DESC " Basically what I've done is made a diary table, and allowed people to comment on each diary entry, with the comments stored in a seperate comments table. What i'm doing there is getting the diary entry, plus the number of comments posted for that entry. Now the problem is that this query only displays entries from the diary table when a comment is added for that entry, otherwise it comes up with a blank, because (diary.id = comments.id) isn't true. Now, is there a way to make sure that it displays all diary entries anyway? because if i remove that check (diary.id = comments.id) - then all the numbers come up messed up. Take a look at the LEFT JOIN syntax. It will allow you to return all records from diary and the records from comments that match based on a common field between the two tables (in this case "id"). This query doesn't give you exactly what you want, but it demonstrates LEFT JOIN usage. You had been doing a STRAIGHT JOIN (using alternate syntax where you didn't actually use those words). SELECT diary.entry, comments.id FROM diary LEFT JOIN comments ON comments.id = diary.id WHERE where_clause; See the MySQL documentation for more details. Hopefully you can figure it out on your own with a few minutes of research, trial and error. -- Steve Werby COO 24-7 Computer Services, LLC Tel: 804.817.2470 http://www.247computing.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] __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.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]
[PHP] How can I do this?? :((
Hi all, I'm basically really struggling with this query, so would appreciate any pointers on how I could do this. I've included my experimental code underneath, and need to make it work. The first query, which I know works, pulls info from a mysql table. Now for each of my diary entry, I want people to be able to add comments. All comments go into another table which records what section that comment came from (which is diary), and the id (which it takes from the id number of the diary entry). Now what I want to do is have another query which asks the second table the number of comments per each section id, for that section, (and I think QUERY2 does this fine). But I need the answers to integrate with the information pulled from first query. How can I intergrate the results from 2 queries into one basically! CODE *** $query1 = " SELECT entry FROM diary WHERE month='$month' ORDER BY id desc"; $result1 = mysql_query($query1); $query2 = "SELECT count(*) AS replies FROM sexsurvey_boys WHERE section='diary' GROUP BY sectionid ORDER BY sectionid desc"; $result2 = mysql_query($query2); if ($result1) { echo "table border=0 cellspacing=0 cellpadding=2 width=90% align=center"; while ($r = mysql_fetch_array($result)) { extract($r); $entry = nl2br($entry); echo " tr bgcolor=#fftd colspan=2$entrybr/td/tr tr bgcolor=#ff tdraquo; a href=\"javascript:popupwin('popupwindow.php?section=diarysectionid=$id',200,530)\"comment on this diary entry/a/td td align=rightread comments, (0) so far./td/tr "; } } else { echo "Whoops!"; } mysql_free_result($result1); * TIA! Sunny __ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.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]
[PHP] Stringing sql queries?
All, can I string 2 sql queries one after the other? like "select * from $table; select * from $table2;" ??? If I can, does that mean if I use mysql_fetch_array then it'll convert results from both queries into variables? TIA __ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.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]
[PHP] Need to count number of rows per id! :(
Hey guys, I need an answer to a problem I've been trying to work on for days :( I made a message board, which has a front page which lists Topic name, topic started by, and what date. All this info, and the topic message is stored in one mysql table. when you click on any of the topics, it leads to a page which lists all replies to that topic by topic_id. Now what I want to do is have a listen on the first index page, the number of replies for that particular topic. I know I need something like select id from $secondtable where topicid=$topicid, and then use mysql_num_rows, but I can't figure out how to integrate the first set of results from table 1 with the query on table 2. This is the query on the front page on the main table : $query = "SELECT topicid, icon, name, topic, datestamp FROM $maintable ORDER by datestamp DESC LIMIT 40 "; $result = mysql_query($query); TIA! Sandeep __ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.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]
[PHP] How do I get last inserted ID?
Hi All, just a quick question. Say my script is inserting values into a database, which has an autoincremental id. Now I usually send out a mail also with the contents of the inserted stuff. The only problem is that of the ID field. How can I get the script to determine what id number was given to that row? thanks /sunny __ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.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]