Jump to content

NathanS

Members
  • Posts

    42
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

NathanS's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi guys, N00bish question: I get a parse error for the below, any ideas why? $body = 'Dear ,<br /><br />Upgrade Form!<br /><br /> '.$form['CurrentVersion'].'<br /><br />'Regards, <br/> <b>The Team</b>'; Thanks, Nathan
  2. Incidently, if I copy/paste the variables into the index instead of including them, it works fine...
  3. function layout_text( $header, $text ) { echo "<TABLE cellSpacing=0 cellPadding=0 width=600 border=0>\r\n<TBODY>\r\n<TR>\r\n<TD vAlign=top colSpan=2>\r\n<TABLE class=TextBoxFull cellSpacing=0 width=585>\r\n<TBODY>\r\n<TR>\r\n</TR>\r\n<TR>\r\n</TR>\r\n<TR>\r\n<TD>\r\n<B>{$header}</B>\r\n</TD>\r\n</TR>\r\n<TR>\r\n<TD>{$text}<BR>\r\n</TD>\r\n</TR>\r\n</TBODY>\r\n</TABLE>\r\n</TD>\r\n</TR>\r\n</TBODY>\r\n</TABLE>"; } And yes, include the language file!
  4. Hi guys, I'm rectifing an old website, and everything works flawlessly bar the languages - its been coded for multiple languages, as such the index page looks like this: echo "<TABLE class=NewsTicker width=585><TBODY><TR><TD><a href=\"chatroom.php?rhx=2523457370726573736F426172\">EspressoBar</a> - <i>All ages welcome at the EspressoBar - Fun and friendly chat!</i></TD></TR></TBODY></TABLE>"; layout_text( "{$_index[0]}", "{$_index[1]} {$_index[2]}" ); layout_text( "{$_index[3]}", "{$_index[4]}<br>{$_index[5]} <a href=\"includes/NPPGWrap.exe\">{$_index[6]}</a> {$_index['7']}" ); layout_text( "{$_index[8]}", "{$_index[9]}" ); layout_footer( ); } With $_index[0] etc being the relative text which is defined in the language files, as below: $_index[0] = "Welcome to N2N Chat!"; $_index[1] = "A new network made especially for you! Why? Because we want to make your online experience as enjoyable as possible, N2N Chat is your best msn chat alternative!"; $_index[2] = "Chat now and get acquainted with the possibilities of N2N Chat today!"; But the error I'm getting is: Notice: Undefined variable: _index in d:\domains\korix.co.uk\wwwroot\n2nchat\index.php on line 9 Over and over again. Any ideas? Thanks!
  5. Hi guys, Got a highly random problem which I can't figure out - have an "edit profile page" where you can fill in info about yourself, and it writes back to a MySQL database. All fields work fine apart from two: Gender and Website. The code is below - anyone any ideas what on earth I'm doing wrong? Thanks! if ($_POST["submit"]) { $form["fullname"] = htmlspecialchars(trim($_POST["fullname"])); $form["location"] = htmlspecialchars(trim($_POST["location"])); $form["website"] = htmlspecialchars(trim($_POST["website"]));; $form["gender"] = htmlspecialchars(trim($_POST["gender"]));; $form["favbands"] = htmlspecialchars(strip_tags(trim($_POST["favbands"]))); $form["bio"] = htmlspecialchars(strip_tags(trim($_POST["bio"]))); $form["level"] = (int)$_POST["level"]; if ($form["gender"] && $form["gender"] != "M" && $form["gender"] != "F") { $form["gender"] = ""; } if ($_FILES["avatar"]["name"]) { $size = getimagesize($_FILES["avatar"]["tmp_name"]); if ($size[0] <= 100 && $size[1] <= 100 && $_FILES["avatar"]["size"] <= 112640) { $current_av = $user->get_avatar(); if (file_exists($current_av) && $current_av != "images/default_av.png") { unlink($current_av); } $new_av = "images/avatars/".$user->_id.".".substr(strrchr($_FILES["avatar"]["name"], '.'), 1); move_uploaded_file($_FILES["avatar"]["tmp_name"], $new_av); } } $user->_fullname = $form["fullname"]; $user->_location = $form["location"]; if (ereg("^http\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\._\?\,\'/\\\+&%\$#\=~\-])*$", $form["website"]) || (!$form["website"])) { $user->_website = $form["website"]; } $user->_gender = $form["gender"]; $user->_favbands = $form["favbands"]; $user->_bio = $form["bio"]; if ($me->_level >= 3) { $user->_level = $form["level"]; } $user->update_profile(); $saved = true; And the writing back to database: function update_profile() { @mysql_query("update `members` set `fullname` = '".sanitize_sql_string($this->_fullname)."', `location` = '".sanitize_sql_string($this->_location)."', `birthday` = '".sanitize_sql_string($this->_birthday)."', `website` = '".sanitize_sql_string($this->_website)."', `gender` = '".sanitize_sql_string($this->_gender)."', `favbands` = '".sanitize_sql_string($this->_favbands)."', `bio` = '".sanitize_sql_string($this->_bio)."', `level` = ".$this->_level." where `id` = ".$this->_id." limit 1"); }
  6. Just notepad, that's what I can't make out!
  7. Hi guys, I'm getting this symbol on my website, when rendering in firefox:  Any ideas what causes this? Thanks!
  8. Yep, also should've probably checked my php.ini for register_globals! Thanks
  9. Hi guys, Having an issue, first time using php self to submit a form - however, am getting: PHP Notice: Undefined index: cover in tform.php on line 2 PHP Notice: Undefined variable: PHP_SELF intform.php on line 11 When loading up the following page: <?php $cover = $_POST["cover"]; if (!isset($_POST['submit'])) { // if page is not submitted to itself echo the form ?> <html> <head> <title>Cover Question</title> </head> <body> <form method="post" action="<?php echo $PHP_SELF;?>"> Do you require cover for less than 28 days? <select name="cover"> <option value="yes">Yes</option> <option value="no">No</option> <input type="submit" value="submit" name="submit"> </form> <? } else { if ($cover =="yes") { header('Location: http://www.adrianflux.co.uk/'); } header('Location: https://www.hertsinsurance.com/epa.php'); } ?> Any ideas? Thanks!
  10. http://www.metalmarketing.co.uk and http://www.wintersnet.net - any constructive critiscism is very welcome! thankyou
  11. Thanks for the reply Using your method, calling _POST['EMAIL'], still only sends an email to the first address. Unsure what I'm doing wrong here
  12. Thanks for the quick reply. I've already done that as follows: echo "<INPUT TYPE='checkbox' name='EMAIL[]' VALUE='$field20' style='visibility:hidden' checked>"; And in the php file, I have the variables declared as follows: $email = $_POST["EMAIL"]; Then I use the foreach loop before the email code - However, it only sends an email to one address. Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.