PHP - Js Noob: Need Help With Some Bootstrap Javascript
I work with PHP and I'm not good with JS.
I want to use a Twitter Boostrap tab funnction: http://getbootstrap....avascript/#tabs
I need some guidance how it uses the JS code mentioned.
The code below taken from the Bootstrap page is obvious enough:
$('#myTab a').click(function (e) { e.preventDefault() $(this).tab('show') })What I do not understand is how I am required to use the following code in the context of the previous code. Ok, I get that I have to choose one option, but I don't get how they fit together and I do not get how I can have 5-7 tabs and how they will be highlighted one after the other as per the given example on the Bootstrap page : $('#myTab a[href="#profile"]').tab('show') // Select tab by name $('#myTab a:first').tab('show') // Select first tab $('#myTab a:last').tab('show') // Select last tab $('#myTab li:eq(2) a').tab('show') // Select third tab (0-indexed)Many thanks for all your help ! Similar TutorialsI have the following php block that works on an existing bootstrap webpage: <?php $isos = glob('download/*.iso'); $iso = $isos[count($isos) -1]; $isoname = basename($iso); $isodown = "/".$isoname; $md5file = md5_file($iso); $pdfs = glob('download/foxcloneV*.pdf'); $pdf = $pdfs[count($pdfs) -1]; $pdfname = basename($pdf); $debs = glob('download/*.deb'); $deb = $debs[count($debs) - 1]; $debname = basename($deb);; $srcs = glob('download/*.tar.*'); $src = $srcs[count($srcs) - 1]; $srcname = ltrim($src,'download/'); ?>
When I try to use it in a non-bootstrap website, it fails with the following errors: Notice: Undefined offset: -1 in /home/larry/web/test2/public_html/download.php on line 104 Warning: md5_file(): Filename cannot be empty in /home/larry/web/test2/public_html/download.php on line 106 Notice: Undefined offset: -1 in /home/larry/web/test2/public_html/download.php on line 109 Notice: Undefined offset: -1 in /home/larry/web/test2/public_html/download.php on line 113 Notice: Undefined offset: -1 in /home/larry/web/test2/public_html/download.php on line 117
Each of these failures is the line after the glob. Is the glob failing or is the syntax wrong for non-bootstrap use? Either way, my thinking is that php should behave the same regardless of what the base model for the website is. Both the bootstrap and non-bootstrap sites are running locally under apache2.4 and php7.2. Can someone provide some insight? I'm a major JS noob and this is driving me nuts. I'm trying to use this in a form:
http://reactiveraven...trapValidation/
And using the examples, can't get anything to work. Only my browser's non-js HTML 5 form validation. Anybody have a simple that incorporates both HTML and JS? The examples only show the html.
Hello all, I have a website with a form that I want a user to fill out then if it is valid I have the button submit and I want it to email me. The message. If success full I want a message to popup on screen saying success I am using bootstrap 4 <div class="messageSuccess"></div> <div class="row"> <div class="col-md-9 mb-md-0 mb-5"> <form id="contact-form" name="contact-form" action="" method="post"> <!--action="contactEmail.php" --> <div class="row "> <div class="col-md-6 "> <div class="md-form mb-0 "> <input class="form-control" type="text" id="txtName" name="txtName" required /> <label for="txtName">Your Name </label> <div class="nameError"></div> </div> </div> <div class="col-md-6 "> <div class="md-form mb-0 "> <input class="form-control" type="text" id="txtEmail" name="txtEmail" required /> <label id="lblEmail" for="txtEmail">Your Email Address </label> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="md-form mb-0"> <input class="form-control" type="text" id="txtSubject" name="txtSubject" data-error="Subject Here" required /> <label for="txtSubject">Subject </label> <div class="help-block with-errors"></div> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="md-form"> <textarea class="form-control" type="text" id="txtMessage" name="txtMessage" rows="4" required data-error="Please leave us a message."></textarea> <label for="txtMessage">Your Message </label> </div> </div> </div> <div class="text-center text-md-left"> <input type="submit" id="BtnFormSubmit" class="btn btn-primary btn-xl text-white" value="Send Message" /> </div> <div class="status"></div> </form> <!-- JavaScript Inner File Form Validation --> <script type="text/javascript"> $(document).ready(function () { var form = $("#contact-form"); var name = $("#txtName").val(); var email = $("#txtEmail").val(); var subject = $("#txtSubject").val(); var message = $("#txtMessage").val(); var btnSubmit = $("BtnFormSubmit"); $(form).submit(function (event) { if (this.checkValidity() == false) { $(this).addClass("was-validated"); event.preventDefault(); event.stopPropagation(); } alert("Form Valid to create message"); if (!event.isDefaultPrevented) { alert("passed prevent default"); var url = "testemail.php"; // POST values 'ajax' $.ajax({ type: "POST", url: url, data: $(this).serialize(), success: function (data) { // done: // data = JSON object object for contactEmail.php // recieve message type: success | danger var messageAlert = "alert- " + data.type; var messageText = data.message; // Bootstrap alert box HTML var alertBox = '<div class="alert ' + messageAlert + ' alert-dismissable"><button type="button" class="close" ' + 'data-dismiss="alert" aria-hidden="true">×</button>' + messageText + '</div>'; // if messageAlert and messageText if (messageAlert && messageText) { // Put message on page in messageSuccess section. $(form).find("#messageSuccess").html(alertBox); // Reset the form. $(form)[0].reset(); } } }); //return false; } }); //$(name).blur(function () { //}) // Validate :inputs $(":input").blur(function () { let controlType = this.type; switch (controlType) { case "text": case "password": case "textarea": validateText($(this)); break; case "email": validateEmail($(this)); break; default: break; } }); // each :input focusin remove existing validation messages if any. $(":input").click(function () { $(this).removeClass("is-valid is-invalid"); }) /* OPTIONAL ':input' KEYDOWN validation messages remove */ // Reset Form and remove all validation messages. $(":reset").click(function () { $(":input").removeClass("is-valid is-invalid"); $(form).removeClass("was-validated"); }); }); // Validate Text Function function validateText(control) { let textField = control.val(); if (textField.length > 1) { $(control).addClass("is-valid"); } else { $(control).addClass("is-invalid"); } } // Validate Email Function (Email newer regex: /^([\w-\.]+@([\w-]+\.)+[\w-]{2,6})?$/ ) function validateEmail(control) { let textField = control.val(); let regexPattern = /^\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,6}\b$/i; if (regexPattern.test(textField)) { $(control).addClass("is-valid"); } else { $(control).addClass("is-invalid"); } } </script> <?php $from = 'SampleEmail@YourEmail.com'; $sendTo = 'sample@Gmail.com'; $subject = 'Your Message Subject Here';// Email Message Contact Form Fields // Array - ($varName => Text from controls) $controls = array('txtName' => 'Name', 'txtEmail' => 'Email', 'txtSubjext' => 'Subject', 'txtMessage' => 'Message'); $successMessage = 'Contact Message Successfully Sent. Thank you, I will get back to you soon.'; $errorMessage = 'There was an error submitting your message, Please try again. Or try later.'; error_reporting(E_ALL & ~E_NOTICE); try { if(count($_POST) == 0) throw new \Exception('Contact Form Message is empty'); $emailText = "You have a new message from your contact form\n------------------------------------------------------\n"; foreach($_POST as $key => $value) { if(isset($controls[$key])) { $emailText .= "$controls[$key]: $value\n"; } } $headers = array('Content-Type: text/plain; charset="UTF-8";', 'From: ' . $from, 'Reply-To: ' . $from, 'Return-Path: ' . $from, ); // Send email mail($sendTo, $subject, $emailText, implode("\n", $headers)); $responseArray = array('type' => 'success', 'message' => $successMessage); } catch(\Exception $e) { $responseArray = array('type' => 'danger', 'message' => $errorMessage); } // If AJAX request return JSON response **RARE** if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { $encodedJSON = json_encode($responseArray); header('Content-Type: application/json'); echo $encodedJSON; } else { echo $responseArray['message']; } ?>
Hi,
I've been looking at the Bootstrap 3 and various tutorials / example sites even from their own website. This has lead me to a question I cannot seem to find a quick answer to why do they use divs over the new HTML5 tags such as nav.
For example;
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">Project name</a> </div> <div class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li class="active"><a href="#">Home</a></li> <li><a href="#about">About</a></li> <li><a href="#contact">Contact</a></li> </ul> </div><!--/.nav-collapse --> </div> </div>Comapred to something more like; <div class="container"> <nav> <ul> <li><a href="#"> Home </a></li> </ul> </nav> </div>I know these two examples don't match up in the slightest but I'm not looking for the synatx just an explaniation. Is it the fact that HTML5 is still the draft stages and IE doesn't handle nav to gracefully wihtout shiv etc... Or is the developer of the examples is just a bit lazy and couldn't be bothered to swap it to the newer tags? The reason I ask is I'm not too sure which way would be the best for developing a site using bootstrap. Thanks in advance. In Bootstrap I have the following piece of code that validate all the fields in the form:
/** * Called when all validations are completed */ _submit: function() { var isValid = this.isValid(), eventType = isValid ? this.options.events.formSuccess : this.options.events.formError, e = $.Event(eventType); this.$form.trigger(e); // Call default handler // Check if whether the submit button is clicked if (this.$submitButton) { isValid ? this._onSuccess(e) : this._onError(e) ; } },What I want is if it's success (this._onSuccess(e)) to submit the form with the following code json: $("document").ready(function(){ $(".js-ajax-php-json").submit(function(){ var data = { "action": "test" }; data = $(this).serialize() + "&" + $.param(data); $.ajax({ type: "POST", dataType: "json", url: "https://www.telekom.ro/delivery/formAction/fix-mobil/response.php", //Relative or absolute path to response.php file data: data, success: function(data) { $(".the-return").html( //"Favorite beverage: " + data["favorite_beverage"] + "<br />Favorite restaurant: " + data["favorite_restaurant"] + "<br />Gender: " + data["gender"] + "<br />JSON: " + data["json"] data["ok"] ); $(".error").html( data["error"] ); //alert("Form submitted successfully.\nReturned json: " + data["json"]); }, }); return false; }); });I tried to replace the "e" from (this._onSuccess(e)) with the code from above but not success. Both code works good individual. Practicaly I need to submit the form, then all the fields are validated, with that json code. Can anyone help me please? I have php file which return data in json format
<?php include_once('con.php'); $mydata = array(); $data = $con -> prepare('SELECT * FROM user'); $data -> execute(); while($result = $data->fetch()) { $mydata[] = $result['id']; $mydata[] = $result['first_name']; $mydata[] = $result['last_name']; } echo json_encode($mydata); ?>
the problem is the footable require both columns and rows how to get colums?
$(document).ready( function() { var ft = FooTable.init('#user', { columns: $.get("how to get the table column"), rows: $.get("row.php") }); }); There is no documentation about how to do that with php look here https://fooplugins.github.io/FooTable/docs/examples/advanced/ajax.html
I built a Bootstrap site but when I view it on my phone (Samsung Galaxy S3), it doesn't collapse the navigation menu into the mobile button like I thought it would. I did some research and realized that my phone is actually the same resolution as my desktop (1920x1080) so it's giving me the desktop view. Bootstrap, to my surprise, only seems to be responsive to resolutions, not physical screen sizes. How do I overcome this? I want to build a site which is responsive to physical screen size, regardless of resolution.
Edited by DeX, 11 June 2014 - 04:01 PM. I have a blog on my website and the blogs content is stored in a database. On my home page I have the two recent articles displayed on my home page but I have to change them manually so I add the recent article on the home page in the first column and the second most recent one in the next column so they are side by side. What I want to do is automatically display the blogs image and blog title from the database and display on the home page so I don't have to keep changing it manually My current code looks like the following <div class="block"> <div class="container"> <h3 class="text-center"><span class="color">Recent Blog Articles</span></h3> <div class="row"> <div class="col-md-6"> <div class="text-img animation" data-animation="fadeInLeft" data-animation-delay="0.5s"> <a href="https://www.it-doneright.co.uk/blog/one-year-to-go-until-end-of-support-for-windows-7"> <div class="image"> <img class="img-responsive" src="https://www.it-doneright.co.uk/images/blog/windows7-eos-new.jpg" alt="One year to go until end of support for Windows 7"> </div> <p>One year to go until end of support for Windows 7</p> </a> </div> </div> <div class="col-md-6"> <div class="text-img animation" data-animation="fadeInLeft" data-animation-delay="0.5s"> <a href="https://www.it-doneright.co.uk/blog/windows-10-is-going-to-require-7gb-of-storage-for-future-updates"> <div class="image"> <img class="img-responsive" src="https://www.it-doneright.co.uk/images/windows-ten-updates-needing-7gb-space-on-hard-drive.jpg" alt="Windows 10 is going to require 7gb of storage for future updates"> </div> <p>Windows 10 is going to require 7gb of storage for future updates</p> </a> </div> </div> </div> </div> </div> I did look on Google before posting but could not get my head around how to do it, could anyone point me in the right direction or start me off and will have a go I have a boostrap conflict regarding box sizing. I solved it with a simple CSS rule:
* { box-sizing: content-box; }Now the problem is my bootstrap form isn't working. I need to make the box sizing apply to everything except the bootstrap form: <form id="contactForm" action="<?php echo htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES); ?>" method='post'> <!-- HTML HERE --> </form>Any ideas? Thanks. I'm using the following script: http://jsfiddle.net/VzVy6/8/ It give a alert message that slide in/out when a required field is still empty on submit. The script works fine, and in this example its only one field. When the field is empty I see the fade in alert message, and when the field has been filled in I see a normal popup alert message: alert("Would be submitting form"); I can't get it to work to change this alert message to a page POST submit. I was looking online, and I see Ajax examples that I don't get to work. What I want is that when all fields are filled in, that the form POST submit to another page including the values in the textboxes ofcourse. Maybe its something really easy, but I have already a headache because tried to get it to work for more then 5 hours in a row. Thank you for your time. Hi,I used bootstrap to create a webpage and one of the special effects is when you scroll down the page the section you are at is highlighted in the menu. This seems to work ok for all of my sections except the About Me section in which case the next section down (resume) is highlighted instead.
Here is the specific area on the page (http://www.inspired-...p#section-about).
I was wondering if anyone familiar with Boostrap and the Amoeba theme had any suggestions on a fix for this.
thanks in advance.
I've been working on developing a CMS blog and now I'm trying to create a slideshow wit Bootstrap Carousel on the homepage to present the dynamic content (images + text) using the data from table 'posts'. I tested this code, and it only presents one post. I mean, It's not possible to go to the next slide. I want to show all the posts on the slides. *The DB connection is already on the includes. The connection was written on a small file called DB.php Home.php <header> <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li> <li data-target="#carouselExampleIndicators" data-slide-to="1"></li> <li data-target="#carouselExampleIndicators" data-slide-to="2"></li> </ol> <div class="carousel-inner" role="listbox"> <?php // The default SQL query $sql = "SELECT * FROM posts ORDER BY id desc"; $stmt = $ConnectingDB->query($sql); while ($DataRows = $stmt->fetch()) { $Id = $DataRows["id"]; $PostTitle = $DataRows["title"]; $Image = $DataRows["image"]; $PostText = $DataRows["post"]; ?> <!-- Slide --> <div class="carousel-item active" style="background-image: url('uploads/<?php echo $Image; ?>')"> <div class="carousel-caption"> <div class="card-body black"> <h3 class="large-mistral-white"><?php echo $PostTitle; ?></h3> <p class="small-times-white"><?php echo $PostText; ?></p> </div> </div> </div> <?php } ?> </div> <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev"> <span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next"> <span class="carousel-control-next-icon" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div> </header> DB.php <?php $DSN='mysql:host = localhost; dbname=everybody_blog'; $ConnectingDB = new PDO($DSN,'root',''); ?>
Please bear with me. In an html file there is an <!-- BEGIN poll --> ..... <!-- END poll --> I need to draw a separation hr between all rows escept the first one. I believe I need a counter. Please show me how to do this. Thank you. i have 8 division (div), i want to display 4 rows in 4 division and the remain 4 rows in the next 4 division here is my code structure for carousel
<div class="nyie-outer"> second row third row
fourth row fifth row sixth row seven throw eighth row
</div><!--/.second four rows here-->
sql code
CREATE TABLE product( php code
<?php how can i echo that result in those rows
I had a developer working on stuff for my site and he died before he got to the uploader. I am not a programmer. I can alter a few basic things, but this is beyond me. I found this basic uploader that I could edit the locations, file types, etc. It is missing one area of functionality that I need, the ability to define how many upload fields through a variable (which is set in an earlier form). So for example $fields = "3" then 3 upload fields appear with descriptions set by variables (for examples sake...front and then upload area, back and then upload area, misc. and upload area). I know this might not make a lot of sense. If you need any clarification please contact me. Any help would be much appreciated! well, here's my problem, im new to php, i currently working on this mini online shop the picture will explain it well, i've managed to create the receipt per shop but i cant do the receipt of the overall shopping here is my code: <html> <head> <title>My Shop 4</title> <script type="text/javascript"> function gohome() { window.open("receipt.php","_self"); } function changeshop() { window.open("home.html","_self"); } </script> </head> <body> <form action="" method="POST"> <input type="checkbox" name="prod1" id="prod1"\ value=10>Product 1 10.00php<br> <input type="checkbox" name="prod2" id="prod2"\ value=20>Product 2 20.00php<br> <input type="checkbox" name="prod3" id="prod3"\ value=30>Product 3 30.00php<br> <input type="checkbox" name="prod4" id="prod4"\ value=40>Product 4 40.00php<br> <input type="checkbox" name="prod5" id="prod5"\ value=50>Product 5 50.00php<br> <input type="submit" name="submit" id="submit" value="Buy!!"><br> <?php $det = 4; require("../Labphp/lab.php"); shop($det); ?> </form> </body> </html> and here's the php part <?php $total = 0; $total3 = 0; $total4 = 0; $recent ="HAHAHA"; global $total,$total3,$total4,$recent; ?> <?php function shop($num) { $value1 = $_POST['prod1']; $value2 = $_POST['prod2']; $value3 = $_POST['prod3']; $value4 = $_POST['prod4']; $value5 = $_POST['prod5']; $sum=0; $sum = $value1 + $value2 + $value3 + $value4 + $value5; if($sum!=0) { echo "Selected Products<br>"; echo "Product Name       Price<br>"; if($value1==true) { echo "Product 1              10.php<br>"; } if($value2==true) { echo "Product 2              20.php<br>"; } if($value3==true) { echo "Product 3              30.php<br>"; } if($value4==true) { echo "Product 4              40.php<br>"; } if($value5==true) { echo "Product 5              50.php<br>"; } echo "Total                     $sum php<br>"; if($num==4) { $total4=$sum; $recent.="Shop 4                  $total4 php<br>"; } else if($num==3) { $total3=$sum; $recent.="Shop 3                  $total3 php<br>"; } $total = $total4 + $total3; echo "$recent              $total"; echo "<input type='button' name='go' id='go' value='Choose Another Shop' onclick='javascript:changeshop();'>"; echo "<input type='button' name='end' id='end' value='End Shopping' onclick='javascript:gohome();'>"; } } function getshopping() { return $recent; } ?> the receipt code <?php require("../Labphp/lab.php"); ?> <html> <head> <title>Official Receipt</title> </head> <body <?php echo $_REQUEST["'$recent'"]; ?> </body> </html> So I'm trying to learn PHP so that I can work with the SteamAPI.
I have previous coding experience (C, Java) and I'm uncertian on why my script isn't working.
API: https://github.com/a...teamweb-php-api
Error:
Parse error: syntax error, unexpected '[' in index.php on line 51
Line 51:
$parameters = ['key' => STEAM_WEB_API_KEY];From what I've understood, the script is trying to create an array called "parameters" and inside it's trying to create a variable called "key" which is going to hold the constant "STEAM_WEB_API_KEY". This constant is suppose to be loaded from a file called "steamwebapi_config.php" which looks like the following: <?php /** * Steam Web PHP API */ const STEAM_WEB_API_KEY = 'your steam api key that is given by vavle';I didn't attach my actual key in the script above for obvious reasons. I have no idea how to fix this issue nor what is casuing it. Again, I'm not experienced with PHP and I'd appreciate any help you guys can give me! Thanks to anyone who helps. Hi there I'm new in the php coding and I just don't undestand most of all database settings etc... so I have something to do but I don't know exactly how so here is the thing: The disciplines are separated into modules. A module contains lectures and more than 1 group that gets exercises and practical training. The necessary number of the hours of a module is formed of the sum of the hours of lectures, exercises and practical training, multiplied by the numbers of the groups. The site has to give the possibility of: - Writing into new modules and lecturers. - Defining the number of groups (lectures, exercises, practical training) for a module. - Appropriating of groups and lecturers. - Visualizing the list of modules/lecturers. if you can help with advices or whatever you can I'll be very thankfull Hello, I'm new to this forum, and I have just spend half an hour typing out my question as complete as possible, and just before I wanted to hit the "Post" button, I pressed "why not?" out of curiousity @ Read the rules before you post! We will NOT edit/delete your content (why not?)! so I lost everything I wrote. Anyway. I'll shortly retype it all: I'm a Dutch student - therefore my English isn't that good, I'm sorry for that - and for school, I have to make a website. It has to include a CMS system, a search-box, a contactform, Google Analytics and Google Maps. In the meantime, I don't even seem to be able to write 3 php lines properly. When I tried to, and uploaded my work, my site (www.amstel-webdesign.nl) told me: Parse error: syntax error, unexpected T_STRING in /home/amstelwd/domains/amstel-webdesign.nl/public_html/index.php on line 119 Hereunder, please find the source: Code: [Select] <!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>Amstel webdesign & graphics</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <!-- header start --> <div id="header"> <ul> <li><a href="">Homepage</a></li> <li><a href="">Over ons</a></li> <li><a href="">Webdesign</a></li> <li><a href="">Graphics</a></li> <li><a href="">Prijzen</a></li> <li><a href="">Contact</a></li> </ul> </div> <!-- header end --> <!-- body start --> <div id="body"> <div class="left"> <a href="#" title="Over ons"><img src="images/hobby_profession.png" alt="Onze hobby is ons beroep geworden..." width="780" height="305" border="0" /></a><br class="spacer" /> <br class="spacer" /> <h2><span>Home</span>page</h2><br /> <br /> <p>Is het niet ieders droom om van je hobby je werk te maken? Wij, webdesigners van Amstelland, zijn erin geslaagd die droom waar te maken. Als kleine jongetjes vonden wij het al leuk om met computers te spelen, inmiddels doen wij dat als werk. Maar dat betekent niet dat wij ons werk niet serieus nemen. Juist omdat wij zo van webdesign houden, zullen wij er alles aan doen om ervoor te zorgen dat het u aan niets ontbreekt. Wij zijn toegewijde professionals die plezier hebben in hun werk. En dat merkt u ook! Wij zijn niet vies van zware opdrachten of lastige problemen, we zien het als een uitdaging... </p> <p>Heeft u al een website, dan kunt u deze gratis door ons laten testen. Wij testen op een aantal essentiële onderdelen van uw site. U krijgt snel een kort, duidelijk en uiteraard vrijblijvend rapport, met daarin eventueel te verbeteren punten. Daarna heeft u de mogelijkheid om ons de punten in kwestie te laten verbeteren, en de website te laten onderhouden, tegen een scherp tarief. Heeft u interesse in een dergelijke test, maakt u dan een afspraak met ons. Als u het contactformulier invult, te vinden onder de menuknop <a href="">contact</a>, dan nemen wij zo spoedig mogelijk contact met u op. <br /> </p> </div> <div class="right"> <h2><span>Diensten</span></h2><br /> <ul> <li><a href="#">Webdesign </a></li> <li><a href="#">Consultancy </a></li> <li><a href="#">Onderhoud </a></li> <li><a href="#">CMS </a></li> <li><a href="#">SEO </a></li> <li><a href="#">Webshop ontwikkeling </a></li> <li><a href="#">Contactformulier ontwikkeling </a></li> <li><a href="#">Zoekfunctie ontwikkeling </a></li> <li><a href="#">Google Analytics </a></li> <li><a href="#">Google Maps </a></li> <li><a href="#">Mobiel </a></li> <li><a href="#">Huisstijl ontwikkeling </a></li> <li><a href="#">Drukwerk </a></li> <li><a href="#">Vertalingen </a></li> </ul> <br /><br /> <form method="post" action="#" name="search" class="search"> <label><span>Zoek</span>functie</label> <br class="spacer" /> <input name="search" type="text" id="search" /> <a href="#" title="Advance search">Geavanceerd zoeken</a><input name="" type="image" src="images/search_btn.gif" title="Search" class="searchBtn"/> </form> <form method="post" action="#" name="login" class="login"> <h2><span>Log-</span>in</h2><br class="spacer" /> <label>Naam</label><br class="spacer" /> <input name="name" type="text" id="name" /><br class="spacer" /> <label>Wachtwoord</label><br class="spacer" /> <input name="password" type="password" id="password" /><br class="spacer" /> <input name="" type="image" src="images/login_btn.gif" title="Login" class="loginBtn" /> </form><br class="spacer" /> </div> <br class="spacer" /></div> <!-- body end --> <!-- footer start --> <div id="footer"> <div class="footer"> <div id="nav_left"> <a href="" title="Home">Home</a> <br /> <a href="" title="Over ons">Over ons</a> <br /> <a href="" title="Webdesign">Webdesign</a> <br /> <a href="" title="Graphics">Graphics</a> <br /> <a href="" title="Prijzen">Prijzen</a> <br /> <a href="" title="Contact">Contact</a> <br class="spacer" /> </div> <div id="nav_center"> <a href="">Webdesign</a> <br /> <a href="">Consultancy</a> <br /> <a href="">Onderhoud</a> <br /> <a href="" title="Content Management System">CMS</a> <br /> <a href="" title="Search Engine Optimization / Zoekmachine Optimalisatie">SEO</a> <br /> <a href="">Webshop ontwikkeling</a> </div> <div id="nav_right"> <a href="">Google Analytics</a> <br /> <a href="">Google Maps</a> <br /> <a href="">Mobiel</a> <br /> <a href="">Huisstijl ontwikkeling</a> <br /> <a href="">Drukwerk</a> <br /> <a href="">Vertalingen</a> </div> </div> </div> <!-- footer end --> </body> </html> The php part is marked in red (I hope)... And line 119 is echo ("Amstel_webdesign_graphics" date ("Y")) Could someone please tell me what I'm doing wrong, and what it's all supposed to be? Before I uploaded my index.html with the php lines, my piece was xhtml 1.0 strict and had a valid CSS. I left part of the footer out, so if that created any mistakes (a </div> too many or not enough or such), it probably has nothing to do with the php fail. Thanks so much in advance. Anthony Hi. I'm currently taking a class in PhP and I'm having issues getting my code to work. I "borrowed" part of the code from elsewhere (but I fully understand each line - which is really the point of learning) I'm hoping a second set of eyes might help on what's wrong: I'm running Wamp Server v2.0 on my local PC to test the scripts... I'm sure I'm probably going to have more then just this error with the script, but it's hard to move forward when you're stuck spinning your wheels. Any help would be greatly appreciated... and any suggestions as to a better way to approach this would be welcome as well. I am here to learn after all Here's the error I'm getting: Notice: Undefined variable: fname in C:\Web Server\wamp\www\daystoxmas.php on line 8 Please return to the main page and enter your First Name. Here's the HTML Code: <!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" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Days to Christmas Form</title> </head> <body> <div><p><h1>Days to Christmas Form</h1></p> <p>- Programmed by: Michael Custance</p> <form action="daystoxmas.php" method="post"> <p>First Name: </select><input type="text" name="fname" size="20" /></p> <p>Last Name: </select><input type="text" name="lname" size="20" /></p> <p>E-mail Address: <input type="text" name="email" size=20 /></p> For Christmas gift ideas, click here! <input type="submit" name="Submit" value="Christmas Gift Page" /> </form> </body> </html> And here's the PhP Form: <HTML> <HEAD> <TITLE>daystoxmas.php</TITLE></HEAD> <BODY> <?php if ($fname) { print ("Good "); if (date("A") == "AM") { print ("morning, "); } elseif ( (date("H") >= 12 ) and (date("H") < 18) ) { print ("afternoon, "); } else { print ("evening, "); } print ("$FirstName<P>"); $Christmas = mktime(0, 0, 0, 12, 25, date('Y')); $today = mktime(); $seconds_to_christmas = $Christmas - $today; $days_to_christmas = $seconds_to_christmas / 86400; $days_to_christmas = floor($days_to_christmas); $temp_remainder = $seconds_to_christmas - ($days_to_christmas * 86400); $hours = floor($temp_remainder / 3600); $temp_remainder = $temp_remainder - ($hours * 3600); $minutes = round($temp_remainder / 60, 0); echo '<p>There is ' . $days_to_christmas . ' days and ' . $hours . ' hours and ' . $minutes . ' minutes until Christmas</p>'; } else { print ("Please return to the main page and enter your First Name."); } ?> </BODY> </HTML> |