Jump to content

darknightelor

Members
  • Content Count

    21
  • Joined

  • Last visited

Community Reputation

0 Neutral

About darknightelor

  • Rank
    Newbie

Previous Fields

  • Languages
    HTML, XHTML, CSS.

Contact Methods

  • Website URL
    http://
  • ICQ
    0
  1. The code you gave me is not good.Gives me this error:"Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING "How to fix it, what is the proper code?Edit: OKay, I managed to fix this problem. But now I got more problems:1.I've got a header at the top of the php : header("Content-Type: text/html; charset=ISO 8859-8"); But it cause problem because there is another header in the "else": else { // if verification code was incorrect then return to contact page and show error header("Location:".$_SERVER['HTTP_REFERER']."?subject=$subject&from=$from&message=$message&wrong_code=true"); And when the else applies, it gives "Header may not contain more than a single header, new line detected." error...2.Subject title still in gibberish...
  2. I did change it. But no matter what the subject comes as gibberish. I even tried:enctype="multipart/form-data" accept-charset="UTF-8" in the formand "header("Content-Type: text/html; charset= Windows-1255");" in the php (tried also utf-8 and).Also, please can you tell me how to add a "name" field into this form (I managed to add name field, but it caused the "from" field to disappear making no email sender).EDIT: Okay, I managed to receive the message in the real language. I used ISO 8859-8. Now I only need to know how to add another field.
  3. Hello all,I'm using a contact form from this source http://www.thewebhelp.com/php/php_contact_...age_validation/,And I've run into a few problems:1.I want to add a name (full user name) field into the form. Can you please show me what to do (just paste the code with the changes).2.I wanna send the message in a non-English language which uses UTF-8. But when I get the email, the subject is in gibberish, how do I make it be sent in UTF-8?This is the code (which you can also download from the link I gave):Contact.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Contact Us</title><script type="text/JavaScript"><!--function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x;}function MM_validateForm() { //v4.0 var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n'; } else if (test!='R') { num = parseFloat(val); if (isNaN(val)) errors+='- '+nm+' must contain a number.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n'; } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; } } if (errors) alert('The following error(s) occurred:\n'+errors); document.MM_returnValue = (errors == '');}//--></script></head><body> <form action="mailer.php" method="post" name="form1" id="form1" style="margin:0px; font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px; width:300px;" onsubmit="MM_validateForm('from','','RisEmail','subject','','R','verif_box','','R','message','','R');return document.MM_returnValue">Your e-mail:<br /><input name="from" type="text" id="from" style="padding:2px; border:1px solid #CCCCCC; width:180px; height:14px; font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;" value="<?php echo $_GET['from'];?>"/><br /><br />Subject:<br /><input name="subject" type="text" id="subject" style="padding:2px; border:1px solid #CCCCCC; width:180px; height:14px;font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;" value="<?php echo $_GET['subject'];?>"/><br /><br />Type verification image:<br /><input name="verif_box" type="text" id="verif_box" style="padding:2px; border:1px solid #CCCCCC; width:180px; height:14px;font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;"/><img src="verificationimage.php?<?php echo rand(0,9999);?>" alt="verification image, type it in the box" width="50" height="24" align="absbottom" /><br /><br /><!-- if the variable "wrong_code" is sent from previous page then display the error field --><?php if(isset($_GET['wrong_code'])){?><div style="border:1px solid #990000; background-color:#D70000; color:#FFFFFF; padding:4px; padding-left:6px;width:295px;">Wrong verification code</div><br /> <?php;}?>Message:<br /><textarea name="message" cols="6" rows="5" id="message" style="padding:2px; border:1px solid #CCCCCC; width:300px; height:100px; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;"><?php echo $_GET['message'];?></textarea><input name="Submit" type="submit" style="margin-top:10px; display:block; border:1px solid #000000; width:100px; height:20px;font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; padding-left:2px; padding-right:2px; padding-top:0px; padding-bottom:2px; line-height:14px; background-color:#EFEFEF;" value="Send Message"/></form></body></html> Mailer.php <?php// ----------------------------------------- // The Web Help .com// ----------------------------------------- // remember to replace you@email.com with your own email address lower in this code.// load the variables form address bar$subject = $_REQUEST["subject"];$message = $_REQUEST["message"];$from = $_REQUEST["from"];$verif_box = $_REQUEST["verif_box"];// remove the backslashes that normally appears when entering " or '$message = stripslashes($message); $subject = stripslashes($subject); $from = stripslashes($from); // check to see if verificaton code was correctif(md5($verif_box).'a4xn' == $_COOKIE['tntcon']){ // if verification code was correct send the message and show this page mail("you@email.com", 'Online Form: '.$subject, $_SERVER['REMOTE_ADDR']."\n\n".$message, "From: $from"); // delete the cookie so it cannot sent again by refreshing this page setcookie('tntcon','');} else { // if verification code was incorrect then return to contact page and show error header("Location:".$_SERVER['HTTP_REFERER']."?subject=$subject&from=$from&message=$message&wrong_code=true"); exit;}?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>E-Mail Sent</title><style type="text/css"><!--body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 12px;}--></style></head><body>Email sent. Thank you.<br /><br />Return to <a href="/">home page</a> ? </body></html> NOTE: I save it as UTF-8 and then using Notepad++ Convert it to ANSI. Please help me,Thanks.
  4. Hello all!I need a JS code which will show certain text if you click on an anchor text and hide that text if you click on the anchor text again.For example: You click on item on a list "Names" you get a smaller list opened: "John" "Adam" "Moiraine" "Logain", and when you click on "Names" again, the smaller list closed.Now, I already managed to go this far: <html><head><script>function sw(y,x){t=document.getElementById(x).stylet.display=(y=='on')?'block':'none'}</script><style>#div1,.div2 {display:none;}</style></head><body><ul style="list-style-type:none;"><li><button onclick=sw('on','div1')>Names</button><ul><div id="div1"><li>Adam</li></div></ul></ul></body></html> As you can see, I can't do the following: Make the smaller list be closed by the same button (probably need If statement in the script), and I can't make the script work on regular anchor, but only on "button".Please help me.
  5. Hello all!I'm not sure if it's in Javascript, but I need to make it possible for certain text in my html page show only to IE users and not to firefox users, that's because I want to make an embed (<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95>) music tracker show on the page. For some reason, FF can't show that embedded movie (dunno why, maybe you know a code to solve this?). So I want the specific text that comes with the object to be shown only to IE users.Here's the code: <p style="text-align=center; margin-top: 30%"><span style="color: blue; font-size: 13px;"><!-- I want this to disappear for a FF user -->We've added a background music for your pleasure, Click the small triangle to start it.</span><br /><object id="music" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"> <param name="FileName" value="sounds/music.wav" /> <param name="AutoStart" value="false" /> <param name="loop" value="true" /></object></p> Thank you for your help!
  6. Hello all!I have a few questions:1.How do I make a table be present right next to another table? I mean, I want a table on the left side and next to it (tight to it) another table (right side). I want this to be 2 tables, not table cells.2.How do I adjust the background of the table? I want the background to be in the same size of the table, so when a background image is too big, it will be resized to the size of the table.Thank you!
  7. Alright. What about the other two questions: 1.But how exactly can I manage a site like that in CSS? I mean, in CSS the function of 'Table' is just to design the inner table of the html. I mean, look at W3Schools homepage, it's built from tables. I thought at first they open every link in the middle cell, but it seems it opens in a new page with same structure.2.How do I edit the Background Image of the cell? I entered a image as bacground, but I want it to be as the exact size of the cell.Or, is it possible to make it possible to write OVER a image (a regualr one), which means the image will be like a background.Thanks in advance for every shred of help you can supply.
  8. But how exactly can I manage a site like that in CSS? I mean, in CSS the function of 'Table' is just to design the inner table of the html. I mean, look at W3Schools homepage, it's built from tables. I thought at first they open every link in the middle cell, but it seems it opens in a new page with same structure.______________________________________________________ AJAX is complicated, isn't it? And is it free at all? I thought it was based on server side and not costumer? I want something pretty and simple for my site, yet clever. ______________________________________________________Another question:How do I edit the Background Image of the cell? I entered a image as bacground, but I want it to be as the exact size of the cell.Or, is it possible to make it possible to write OVER a image (a regualr one), which means the image will be like a background.Thank you.
  9. Hello all!For those who remember me, I asked here a lot of questions regarding frames.But now I switched for tables, thus I have new questions:-Is it possible to make a link open in just a cell in the table? I mean, I tried doing it with id=" " But no good. In frames, the link can be opened in one of the frames you choose, but in the table, since all the cells are at one html and not independent, I can't seem able to do it. Another question, in general, what's better: Frames or Tables (gotta choose one of them, if possible: explain why)?And, do you know of ways to make to page to be loaded faster. Because using a timer function, I noticed both in Frames and Tables to loading time is kinda long (about 150 thousands of a second)?Thank you!
  10. darknightelor

    Link color

    Hello all!How do I change the color of a link, I mean, the default is blue and I tried changing it with CSS (color:green;) but it just won't help.Thank you.
  11. Thanks,But it didn't actually work for me, not sure why. Maybe it's because it can't bookmark the page while it's in my computer's directory and not online yet. Nevertheless, I appreciate your help.
  12. Hello all!I was wondering if there's a command to add to the page of "add to my favourites", which means, when a visitor will click it, the page will automatically be added to his favourites. I just wanna use it to make up for the usage of "Frames" which sometimes gives adding to favourites a hard time.If there's any explanation about this in W3schools, please link me to it, I couldn't find any.Thank you!
  13. This is weird, though. When I use the attribute "border", it works fine and changes the border accordingly (8 will show wider border than 1).And how can I arrange my page with CSS the way I do it with frames? I mean, with the frameset I can edit each frame on its own without one long html code to define it all (or CSS code).
  14. Hello all,When I try to validate HTML page with the XHTML validator, it says no attribute as "border" exists. Which is very weird, surely that attribute exists, it defines the size of the border of the frame. So, why the heck won't it let me validate the page?! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title> Body </title> </head><frameset rows="8%,82%,8%" border="0" > <frame src="upper_frame.html" name="upper" scrolling="no" noresize> <frame src="middle1_frame.html" name="middle1" scrolling="auto" noresize> <frame src="lower_frame.html" name="lower" scrolling="no" noresize></frameset><body> </body></html> And one other small thing: Is it recommanded to work with frames? I've read a long article saying Table is BAD, and then I read here a comment that Frame is not good. Can someone with alot of expereince advise me?Thank you.
  15. Thanks, I'll use it. But I just realized my problem was that I didn't save the CSS as Unicode too, like the html...lol, how awkward.Thanks for all the help.
×
×
  • Create New...