Jump to content

jesushax

Members
  • Posts

    498
  • Joined

  • Last visited

    Never

Everything posted by jesushax

  1. ok soo heres where im at, using your code above as guidelines this should work yes? but it doesnt $str = $rsEdit["ClientServices"]; $str = str_replace(":", "'", "$str"); $str = str_replace("''", "', '", "$str"); $services = array($str); ?> <table width="50%%" border="0"> <tr> <td>XHTML/CSS Standards Compliant</td> <td><input type="checkbox" name="chkXHTML" value="XHTML/CSS Standards Compliant" class="blank" <?php if(in_array('XHTML/CSS Standards Compliant', $services)) {echo 'checked="checked"';} ?> /></td> echoing $str gives 'XHTML/CSS Standards Compliant', 'Webpage Design', 'Form to PDF/Email', 'Corporate Branding' so why it no work? cheers
  2. just change the field value to varchar and set a lenght of about 10 should be fine, less hassle
  3. move that username code above the sql then echo the variable in your code the username wont add becuase the variable is created after the sql where youve used it sooo =$user->userName $title = addslashes($_POST['title']); $post = nl2br(addslashes($_POST['post'])); $time = date("g:i a"); $query = "INSERT INTO news (`title`, `author`, `post`, `date`, `time`) VALUES ('$title', '$name', '$post', 'NOW()', '$time')"; $result = @mysql_query($query); and <td width="30%"><?php echo $user; ?></td>
  4. ok heres what i have, it doesnt work though <?php $services = array($rsEdit["ClientServices"]); ?> <table width="50%%" border="0"> <tr> <td>XHTML/CSS Standards Compliant</td> <td><input type="checkbox" name="chkXHTML" value="XHTML/CSS Standards Compliant" class="blank" <?php if(in_array('XHTML/CSS Standards Compliant', $services)) { echo 'checked="checked"'; } ?> /></td>
  5. 1. you need to retrrive the name from the form e.g. $name = $_POST["name"]; add that near the $title variable for ease 2. header("Location: /redirecturl.php"); 3. i dont understand what your doing here...
  6. hi im after creating an if statment that will look up a field value and if a certain selection of words = something then execute code for example FieldAnimal: 'dog''cat''mouse''bird' if ($rs["FieldAnimal"] = dog) {code} but obviously the field doesnt = dog i need a way to find out if the field has dog init any ideas? thanks
  7. ahhh i see, i like it thanks alot
  8. thanks alot, could you show me how it works i like to know how things work so i can recreate situations again if needed thanks
  9. hi i have a field in my mysql db in this filed it will have items like this 'item1''item2''item3''item4' can someone show me how to use the split function to split the words between the '' so i actaully only want the words item1 item2 item3 item4 then how to print those words like <li>item1</li> <li>item2</li> <li>item3</li> <li>item4</li> thanks alot for any help
  10. Hi my contact form sends an email to an address within my domain or atleast its supposed to if i change the address to outside of the domain it works and the email comes from my ssh domain name @domain(loads of numbers).com i set up ssh on my server not knowing what it is or does, i pressed the setup thing in hope that it would tell me what it was, didnt think it would turn it on lol so now i need to know how to configure the ssh to make my contact form work i have this putty ssh tool and know how to login but dont know what else to do can anybody guide me? thanks
  11. anyone know how to configure ssh so my contact form will send to my domain? cheers
  12. right i have this putty ssh software and am currently logged in but have no idea what to do here
  13. when i send it to a address inside my doman it doesnt work i sent it to a hotmail account it works i dont fully understand ssh but know i have it set up on my account its on a hosted server what do i do with the ssh stuff?
  14. yes its in the header ive already posted all the variables they all echo a response so is it something server side? Cheers
  15. $contactemail is set in the include emails.php
  16. yes error reporting is on i get no error messages from it and i have echoed every variable to make sure they all work and nothing :S but the code is fine yes?
  17. can no one see a error? is there one anyway or is it something else?
  18. Hi here is my code for my contact form could anyone tell me if there is a problem here cos the emails arent sending :S Cheers <?php include($_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'); ?> <div id="subs"> <div id="subs-text">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam mollis scelerisque mi.</div> <div id="subs-image"><img src="/images/layout/front/1.png" alt="Home Image" /></div> </div> <div id="backlinks"><?php include($_SERVER['DOCUMENT_ROOT'] . '/includes/backlinks.php'); ?></div> <div id="content"> <div id="content-left"> <h3>Contact Us</h3> <?php switch(@$_GET["action"]) { case "send": $name = $_POST["txtName"]; $email = $_POST["txtEmail"]; $tel = $_POST["txtTel"]; $details = $_POST["txtDetails"]; $to = $contactemail; $subject = "Contact Form"; $message = " <html> <head> <title>HTML email</title> </head> <body> <table> <tr> <td>Name:</td> <td>$name</td> </tr> <tr> <td>Email:</td> <td>$email</td> </tr> <tr> <td>Tel:</td> <td>$tel</td> </tr> <tr> <td style=\"vertical-align:top\">Details:</td> <td>$details</td> </tr> </table> </body> </html> ";// Always set content-type when sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";// More headers $headers .= 'From: info@cwservicesltd.co.uk' . "\r\n"; mail($to,$subject,$message,$headers); echo '<p>your message</p>'; echo '<p>'; echo $message; echo '</p>'; echo '<p>Has been sent and one of your friendly team will get back to you as soon as possible.</p>'; break; default: ?> <form method="post" id="contact" action="?action=send"> <table> <tr> <td>Name:</td> <td><input name="txtName" type="text" id="txtName" size="50" /></td> </tr> <tr> <td>Email:</td> <td><input name="txtEmail" type="text" id="txtEmail" size="50" /></td> </tr> <tr> <td>Tel:</td> <td><input name="txtTel" type="text" id="txtTel" size="20" /></td> </tr> <tr> <td style="vertical-align:top">Details:</td> <td><textarea name="txtDetails" id="txtDetails" cols="35" rows="7"></textarea></td> </tr> <tr> <td> </td> <td><input type="submit" name="Submit" id="Submit" value="Submit" /></td> </tr> </table> </form> <?php break; } ?> </div> <div id="content-right"> </div> <?php include($_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'); ?>
  19. hi below is my code could anyone tell me whats wrong? echoing $error doesnt seem to work cheers <?php include($_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'); function ShowForm() { ?> <div id="content-left"> <form id="form" method="post" action="/includes/login.php" class="menu"> <table> <tr> <td>Username:</td><td><input name="txtUserName" type="text" size="20" /></td> </tr> <tr> <td>Password:</td><td><input name="txtPassword" type="password" size="20" /></td> </tr> <tr> <td colspan="2" style="text-align:right;"><input name="submit" type="submit" value="Login" /></td> </tr> <tr> <td colspan="2"> </td> </tr> <td colspan="2">Lost your password? <a href="/includes/lostpass.php">Click Here</a></td> </tr> </table> </form> </div> <div id="content-right"><span style="padding:30px 0 0 20px;"><?php echo $error; ?></span></div> <?php } switch(@$_GET["action"]) { Case "adminonly": $error = '<span style="font-weight:bold; color:#FF0000;">Error: You need to be a designer to access these pages.</span>'; echo "<h3>Client Log In</h3>"; ShowForm(); break; Case "noaccount": echo "<h3>Client Log In</h3>"; $error = '<span style="font-weight:bold; color:#FF0000;">Error: You need to be a designer or a client to access these pages.</span>'; ShowForm(); break; Case "invalid": echo "<h3>Client Log In</h3>"; $error = '<span style="font-weight:bold; color:#FF0000;">Error: Either your username or password are incorrect.</span>'; ShowForm(); break; Case "sent": echo "<h3>Client Log In</h3>"; $error = '<span style="font-weight:bold; color:#FF0000;">Error: Your Password has been sent to the email address provided</span>'; ShowForm(); break; default: echo "<h3>Client Log In</h3>"; ShowForm(); break; } include($_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'); ?>
  20. done it used a else if steamtment instead $url = $_SERVER['REQUEST_URI']; list($Root, $folder, $page) = split('[/]', $url); if ($folder == "about.php") { echo '<body id="about">'; } elseif ($page == "web.php") { echo '<body id="web">'; } elseif ($page == "marketing.php") { echo '<body id="marketing">'; } elseif ($page == "installations.php") { echo '<body id="installations">'; } elseif ($folder == "portfolio") { echo '<body id="portfolio">'; } elseif ($folder == "contact.php") { echo '<body id="contact">'; } else { echo '<body id="home">'; }
  21. can no one point me in the right direction here? what it is im trying to do is in my page header, for my css current page to work i need to have the body identfied as <body id="home"> <body id="contact"> etc so i need a way of determining what page we are currently on and set the body id to that page problem is i have pages in subfolders and in my root folder thanks
  22. hi what im trying to do is split the current url which i have below then use the folder name in a switch and the page name in a switch so if the current url is in a certain folder (folders listed in the switch case) then do something but if the current url is in a certain page (pages listed in another switch) then do something so is there something like switch else isntead of default? of could i do an if statement to check it id the url is in any of listed folders then if true go to one switch if false go to another switch can i have switches inside a if statement? anyone understand me..? may be a little confusing lol CHeers <?php $page = $_SERVER['REQUEST_URI']; list($Root, $folder, $page) = split('[/]', $page); switch(@$_GET["page"]) { Case "about.php": break; default: echo $page."<br/><br />"; echo "Root: $Root<br />Folder: $folder<br /> Page: $page<br />\n"; break; } ?>
×
×
  • 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.