NathanS
Members-
Posts
42 -
Joined
-
Last visited
Never
Everything posted by NathanS
-
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
-
yeah, that doesn't work unfortunately!
-
Incidently, if I copy/paste the variables into the index instead of including them, it works fine...
-
No joy Thanks for the suggestion though
-
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!
-
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!
-
yep, all fine.
-
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"); }
-
Just notepad, that's what I can't make out!
-
Hi guys, I'm getting this symbol on my website, when rendering in firefox:  Any ideas what causes this? Thanks!
-
Yep, also should've probably checked my php.ini for register_globals! Thanks
-
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!
-
http://www.metalmarketing.co.uk and http://www.wintersnet.net - any constructive critiscism is very welcome! thankyou
-
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
-
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
-
hi guys, i have a form, which the user selects multiple entries using a tickbox. when the form is submitted, it will email each ticked person (well, that's the theory!!) I have tried using foreach in the below way, yet it only ever emails the first person. Any ideas on this? Many thanks foreach ($email as $e) { if ($status == 'Pending') { if ($sourceofbusiness == 'BusinessHere') { $msg = "Message Here"; $recipient = $e; $subject = "Email"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: Company <company@company.com> \n"; mail($recipient, $subject, $msg, $headers); } (code continues in that way, dependednt on status/source of business)
-
I turned magic_quotes off, yet it still does the same thing.. ???
-
I see Excuse my utter ignorance, but in what format would I need to be using stripslashes prior to mysql_real_escape_string() ? Sorry, very new still!
-
'".mysql_escape_string($_POST["LNAME"])." Many thanks for your quick reply! Using the above writes, however it still writes O\\\ to the database, as opposed to O'Connor - any ideas? Thanks again!
-
Hi there, I'm having issues where people are inserting last names such as "O'Connor" and it's not writing to the database correctly: $sql = "INSERT INTO customerav (TITLE, LNAME, PCODE) VALUES ('".$_POST["TITLE"]."', '.$_POST["LNAME"]."', '".$_POST["PCODE"]."')"; How would I best go about removing the apostrophe? Cheers.
-
Still stuck on exactly how to achieve this: this is what I have now: first page: echo "<TD WIDTH=70>"; echo "<font color='#FF6633'>"; echo "<INPUT TYPE='checkbox' ID='NEWID[]' VALUE='$id'>"; echo "</TD>"; echo "</font>"; update page: $sql = "UPDATE customer_insured_party SET ACTIONEDYN = '".$_POST["ACTIONEDYN"]."' WHERE cip_id = '".$_POST["NEWID"]."'"; Am i missing something major? Thanks.
-
Hi guys, Tearing my hair out over this one! Currently returning a list from a database of customers, via an array. It displays without a problem - what I need to be able to do, is add a checkbox by each one, so someone can tick it and click submit, and it'll update the database for that record. How would I go about linking it in with the ID so that this would be possible? Any help on this would be greatly appreciated! Thanks, Nathan.
-
You just made my day! Thankyou very much!
-
Hi guys, I've setup a control panel at work - put simply, it's a way of people being able to view records retrieved from a MySQL database. Currently, they input the ID number into a box and hit "Go" as that's the only way I can think of to pull through the ID number to the next page, so I can do a "SELECT * FROM database WHERE id = $_POST['id'];" Any way I can make the ID's linkable, so they just click on them and it pulls through that ID number that I can use in the select statement? Thanks in advance!
-
Indeed. Am doing my best!