Jump to content

jayjay960

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Everything posted by jayjay960

  1. It would be much better to just learn sql yourself. It's a very simple language. Also I wouldn't be surprised if the problem was just Dreamweaver.
  2. You need quotation marks: <?php if(isset($_GET['id']) && is_numeric($_GET['id'])) { $job_id = (int) $_GET['id']; } $sql = "UPDATE edworld_jobs SET ( contactname = \"$_POST['contactname']\", //THIS IS LINE 15 emailaddress = \"$_POST['emailaddress']\", telephone = \"$_POST['telephone']\", jobref = \"$_POST['jobref']\", jobtitle = \"$_POST['jobtitle']\", startdate = \"$_POST['startdate']\", deadline = \"$_POST['deadline']\", category = \"$POST['category']\", jobdescription = \"$_POST['jobdescription']\", location = \"$_POST['location']\", hours = \"$_POST['hours']\", contract = \"$_POST['contract']\", salary = \"$_POST['salary']\" WHERE JobID = $job_id"; ?>
  3. That code doesn't work because php is only parsed once. The parsed page doesn't get looked at again. This should work: <?php echo '<table width="100%" border="0" cellspacing="0" cellpadding="0" class="itemdetails"> <tr> <td width="1100" height="350" bgcolor="#FFFFFF" class="tento"> <table class="cafe"><tr><td width="547"> <a href="#"><h3 align="justify" style="position:relative; height:5px; top: 10px;">',$row[2] ,'</h3></a> </td> </tr> </table> <table width="1215" height="609" class="chencho" > <td class="largethumb" rowspan="8" align="center"> <a href="#"><img src="../images/image1.jpg" width="270" height="160" alt="coloe"/></a></td> <td width="340" rowspan="8" padding="0" ><table width="252" style="font-size:12px; position:relative; top:-6px;"> <td width="1"> </td> <td width="54" bgcolor="#FFFFFF"><strong>Price:</strong></td> <td colspan="7">$<span class="style3">',$row[6] ,'</span></td> <tr> <td class="style1"> </td> <td colspan="7" class="style3"> </td> </tr> <tr><td> </td><td><strong>Raiting:</strong></td> <td><table height"50" width="47%">'; $ratingData = Rating::OutputRating($platename); if (Error::HasErrors()) { echo Error::ShowErrorMessages(); Error::ClearErrors(); } else { echo $ratingData; } echo '</table></td> </tr>'; ?> You have to end that echo, put the code in, then start another echo for the rest. Oh and just one little thing, it's better not to use the <table>, <tr>, <td> etc. elements. You can use css to create tables. I think xhtml gets rid of those elements.
  4. Are the images pngs? And what browser are you using? Also this is more css than html.
  5. Thanks everyone. Actually I solved this late last night after a lot of looking around. I worked out I needed terminators like rhodesa said. Also I seem to be getting the hang of regular expressions now, I worked out one for making sure email addresses follow the format abc@def.ghi. If anyone's interested here's the username one: <?php preg_match('/^[a-zA-Z0-9_]+$/', $username); ?> The email one: <?php preg_match('/^.+@.+\..+$/',$email); ?> And another script I came up with to check if a date is valid (assuming the user has been given the options 1-31 for the date and 1-12 for the month. $birthday is the date, $birthmonth is the month and $birthyear is the year. at the end of the script $pass will be true if the date is valid or false if otherwise.) <?php $pass = false; switch($birthmonth) { case '2': { if (round($birthyear/4)==$birthyear/4) { if ($birthday>29) { $pass = false; } } else { if ($birthday>28) { $pass = false; } } break; } case '4': { if ($birthday>30) { $pass = false; } break; } case '6': { if ($birthday>30) { $pass = false; } break; } case '9': { if ($birthday>30) { $pass = false; } break; } case '11': { if ($birthday>30) { $pass = false; } break; } } ?>
  6. You need to clear the cache. From memory, in IE you go to Tools > Options and there's something along the lines of "Delete Temporary internet files" or "Delete Offline Data".
  7. The above won't actually center the image properly. If you were to resize the wondow it would stay in the same position, not snap to the center. Unfortunately this is the one thing I've never been able to work out how to do. The only way would be to create a table (using display: table; display: table-row; etc. Not the actual html <table>) of three columns and three rows and place what you want centered in the middle one.
  8. Hi, this is an unfinished script of mine for registering user accounts: <?php $username = $_GET['username']; $password = $_GET['password']; $confirmpassword = $_GET['confirmpassword']; $email = $_GET['email']; $birthday = $_GET['birthday']; $birthmonth = $_GET['birthmonth']; $birthyear = $_GET['birthyear']; $pass = true; $passmessage = ''; if (strlen($username)<3 || strlen($username)>20) { $pass = false; $passmessage = 'Invalid username. Username must be between 3-20 characters long.'; } if ($pass && preg_match('[^a-zA-Z0-9_]', $username)) { $pass = false; $passmessage = 'Invalid username. Username can only contain characters a-z, 0-9 or _.'; } echo $passmessage; ?> It's actually just a page called via ajax and the results are dumped in a box on the registration page. At the moment I've just started to get it to validate the user details, but I've come across a problem in this particular if statement: if ($pass && preg_match('[^a-zA-Z0-9_]', $username)) What I want to do is check if $username contains a character other than a-z, A-Z, 0-9 or _, but it's returning false every time. I've always had problems with regular expressions, and it's annoying me, because I've been using this reference and I can't see what I'm doing wrong. Can anyone help?
×
×
  • 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.