View Full Version : Pease test one more time
Hallow everybody! Today I can proudly(i hope) present you my first forum that i've made myself. Its written on PHP. I've taken some ideas from snits forum but all php code is made by me well just try it and [url="http://www.hauho.bip.ru/forum/default.php"]here[/url:48d9v0dtd8]. Though i've been testing it for million times i think it still has lots of bugs if you find some please let me know.
looks very nice, unfortunately, i'm starting with php, but maybe i'm interested in using the forum in my site when i get used to it. Will it be for free use? And taking profit of your php knowledge, would you please advice on my post? TIA
cu
<font color=green>
Sergi: [url="http://www.meddle.f2s.com"][site][/url:uf5fs9x8xs] || [url="sergi@dhtmlcentral.com"][e][/url:uf5fs9x8xs]
</font id=green>
Edited by - sergi on 30 Aug 2001 18:43:53
Yes its surely free. And I'll put zip archive with all the sourse code as soon as i'll write readme and other stuff of how to use it. By the way now i fixed one bug that didn't let you post messages. about my PHP knowledge: i'm a new bee in PHP too, but its really ease language perhaps the easest that i know <img src=icon_smile_wink.gif border=0 align=middle>
cool, it will be for our use as well. thanx.
i agree it seems to be an easy language. What is intriguing me is the interaction between php and javascript. Correct me if i'm wrong, but in php you cannt set a cookie whenever you want, just onpageload, or you cannt execute a function whenevr you want neither. That's why i'm facing some problems trying to integrate php with my scripts.
cu
<font color=green>
Sergi: [url="http://www.meddle.f2s.com"][site][/url:mf91n402xn] || [url="sergi@dhtmlcentral.com"][e][/url:mf91n402xn]
</font id=green>
Edited by - sergi on 30 Aug 2001 19:26:06
Yup you right about cookies the can only be set at the begining or what is more correct they can be set before any output is sent to the browser. But it ok with functions they are called just in the same way as in javascript, but PHP doesnt have any events so you cant call a function on "document onLoad"
Edited by - Royan on 08/30/2001 20:08:57
thanx for explaination. then, how would you have a function in js contain an order in php as mail() be run whenever i want to? I couldnt find how. tia
cu
<font color=green>
Sergi: [url="http://www.meddle.f2s.com"][site][/url:w32fov5kjg] || [url="sergi@dhtmlcentral.com"][e][/url:w32fov5kjg]
</font id=green>
I didn't get the question. Can you make a sample
thanx royan for your patience. I realized what i need is the following:
how to convert a js variable in to a php variable? Thus means, how to pass the value of a js var to a php var. Even in the same page would work for me. Not that easy.
tia
cu
<font color=green>
Sergi: [url="http://www.meddle.f2s.com"][site][/url:4sm76t3qx6] || [url="sergi@dhtmlcentral.com"][e][/url:4sm76t3qx6]
</font id=green>
Edited by - sergi on 30 Aug 2001 1:12:01
Thats why the hidden field was created. All you need to do is to put the var u need into hidden field and then send it to php script here is the sample:
<form action="phpscript.php">
<input type="hidden" name="jstophp" value="">
</form>
//so after u put some var into this field u submit following in js its being done very simple: document.forms[0].submit()
//and now your js var will look like that in php ($ simbol is declaring var in PHP [the same as var in])
$jstophp=="yourjsvar"
Yes Sergi before i forget can u please test my forum from regitration part and further post some test messages so i could be sure that something is working here is link: [url:v4uqx20vht]http://www.hauho.bip.ru/forum/default.php[/url:v4uqx20vht]
oh, did i forget to say i cannt use forms? sorry about that. I've already tried to use hidden forms but then ie5.0 wont allow me to submit thru javascript (?). Everything was explained in my other (original) topic. Sorry for the inconvenience. It's quite extrange, really, and the hidden form would have been the easiest solution.
cu
<font color=green>
Sergi: [url="http://www.meddle.f2s.com"][site][/url:rkmdqr7sh5] || [url="sergi@dhtmlcentral.com"][e][/url:rkmdqr7sh5]
</font id=green>
Oh yes thank for testing its working but it has some bugs in NS 4 fir reason it (PHP script) doesn't want to read the replies file this is very very strange because it ok in OPERA 5 Do have NS6 to test this forum in this browser it would be great if you could make me such favour. And about hidden forms maybe the reason is that you can ude them only through generated php code. I've never tried to put varaible in js to php maybe i'll be able to help if describe your problem.
hi royan,
my problem is explained [url="http://www.dhtmlcentral.com/forums/topic.asp?TOPIC_ID=2837&FORUM_ID=9&CAT_ID=1&Topic_Title=exec+php+function+thru+js+AFTER+page+l oads%3F&Forum_Title=Off%2Dtopic"]here[/url:vjoq0lrih9]
If need better explaintation, i would provide simpler code to show the case.
tia again.
cu
ps: gone to test the forum in ns6 and performed ok. I used moz092 (ns6.01) under w98se
<font color=green>
Sergi: [url="http://www.meddle.f2s.com"][site][/url:vjoq0lrih9] || [url="sergi@dhtmlcentral.com"][e][/url:vjoq0lrih9]
</font id=green>
Edited by - sergi on 31 Aug 2001 5:49:40
Yes thanks NS6 is OK for this forum now i'll check your proplem...
HI Sergi! Sorry for such late answer, but here's code you need. If you need some explanations just ask
<?if(isset($name)&&isset($email)&&@$msg!=''){
mail($email,"Some feedback from".$name,$msg,"From: $name\n"."Reply-To: your e-mail here\n"."Content-Type: text/plain; charset=koi8-r\n"."Content-Transfer-Encoding: 8bit\n"."Return-path: your e-mail here again\n"."X-Mailer: PHP/" . phpversion());
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Form test</title>
</head>
<body>
Hi <?echo $name;?>, your message has been sent to our mailbox.
A reply will be sent to your <?echo $email;?> address. Meanwhile, your text was:
<?echo $msg;?>
</body>
</html>
<?}if((!@$name||!@$email||!@$msg)&&isset($sent)){ ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Form test</title>
</head>
<body>
Please fill in all forms
<form name="daform" ACTION="email.php" METHOD="POST">
<input name="name" type="text" value="<?echo @$name;?>">
<input name="email" type="text" value="<?echo @$email;?>">
<textarea name="msg" rows=5 cols=55><?echo @$msg;?></textarea>
</form>
Submit (javascript:document.forms[0].submit())
</body>
</html>
<?}else{?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Form test</title>
</head>
<body>
<form name="daform" ACTION="email.php" METHOD="POST">
<input name="sent" type="hidden" value="yes">
<input name="name" type="text" value="">
<input name="email" type="text" value="">
<textarea name="msg" rows=5 cols=55></textarea>
</form>
Submit (javascript:document.forms[0].submit())
</body>
</html>
<?}?>
Works in ie5
royan, thanx a lot for your time and codes. I really apreciate. As i said b4, ie5 does nt want to submit the form via js and php wont retrieve the values. Netscape6 works OK. Here is my code, very simplified to get to the point. If you have the time i'd like to know if this is a ie5 bug or i'm simply stupid.
I did set up an example here[/url:42crrmdj6v] but being php you will need the complete code, so here we go:
testform1.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>[ m e d d l e ] .::. c o m m u n i c a t e </TITLE>
<script language="JavaScript1.2">
var js_name="Sergi";
var js_mail="sergi@here.com";
var js_msg="Hello";
function insertValues(){
document.forms[0].form_name.value=js_name;
document.forms[0].form_mail.value=js_mail;
document.forms[0].form_msg.value=js_msg;
}
</script>
</HEAD>
<BODY>
<FORM name="daform" ACTION="testform2.php" METHOD="POST" ENCTYPE="TEXT/PLAIN">
<input name="form_name" type="text" value="">
<input name="form_mail" type="text" value="">
<input name="form_msg" type="text" value="">
</FORM>
[url="javascript:insertValues()"]insert variables into form (http://www.meddle.f2s.com/test/testform1.php)
submit form (javascript:document.forms[0].submit())
</BODY>
</HTML>
testform2.php
<?if(isset($form_name)&&isset($form_mail)&&@$form_msg!=''){
mail("info@meddle.f2s.com","Some feedback from ".$form_name,$form_msg,"From: $form_name\n"."Reply-To: $form_mail\n"."Content-Type: text/plain; charset=koi8-r\n"."Content-Transfer-Encoding: 8bit\n"."Return-path: $form_mail\n"."X-Mailer: PHP/" . phpversion());
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>results: sent</title>
</head>
<body>
Hi <?echo $form_name;?>, your message has been sent to our mailbox.
A reply will be sent to your <?echo $form_mail;?> address. Meanwhile, your text was:
<?echo $form_msg;?>
</body>
</html>
<?}if(!@$form_name||!@$form_mail||!@$form_msg){ ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>results: not everything filled in</title>
</head>
<body>
Please fill in all fields:
<form name="daform" ACTION="testform2.php" METHOD="POST">
<input name="form_name" type="text" value="<?echo @$form_name;?>">
<input name="form_mail" type="text" value="<?echo @$form_mail;?>">
<input name="form_msg" type="text" value="<?echo @$form_msg;?>">
</form>
Submit (javascript:document.forms[0].submit())
</body>
</html>
<?}?>
really dont know what's wrong here, but ns6 will work perfect and ie5 will submit empty values.
TIA for any help
cu
<font color=green>
Sergi: [url="http://www.meddle.f2s.com"][site][/url:42crrmdj6v] || [url="sergi@dhtmlcentral.com"][e][/url:42crrmdj6v]
</font id=green>
ab_ditto
04.09.2001, 03:53
Hi!
You are submitting the values of variables, not an email, so .... just take out 'ENCTYPE="TEXT/PLAIN"' from testform1.php and everything works fine :)
hi ab_ditto and royan,
BIG THANX TO BOTH OF YOU! This works already (well, couldnt check ie5, but works ns4, ns6 and ie4 so it should be xb), what a small detail, no? I knew it would be a stupid issue.
Anyway, thanx again. You'll be credited for the help anywhere in the site, so if you want to send me your preferred name, mail or site, it would be nice. Oh, and thanx to this help i will be able to launch meddle in 2 weeks, maximum at the end of september.
cu
<font color=green>
Sergi: [url="http://www.meddle.f2s.com"][site][/url:dhsce9bkrg] || [url="sergi@dhtmlcentral.com"][e][/url:dhsce9bkrg]
</font id=green>
Edited by - sergi on 04 Sep 2001 17:04:47
vBulletin® v3.6.7, Copyright ©2000-2008, Jelsoft Enterprises Ltd.