Jump to content

Search the Community

Showing results for tags 'html'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. Hello everybody, I'm working on a back-end system where WordPress is brought in using an iFrame. The iFrame itself is responsive but the editor within the iFrame that wordpress is bringing in isn't responsive. What I'm trying to achieve is an editor (WYSIWYG) that will be responsive for mobile device's. How can I implement an editor that will fulfill these requirements? I'm fairly new to Wordpress but I've worked with PHP and WYSIWYG editors before. I want it to be a safe operation of changing over the editors so that I don't break anything in the application. Any replies and advice would be greatly appreciated Adam
  2. Hey PHP coders, Having trouble with a small application here. I copy/pasted 4 files below. My connect.php (Is the database connection with username, password, etc), index.html (file used to get user information for upload --- its a form that (redirects to create_user.php), create_user.php (my sql statements to upload the form into the database, show_user.php (redirected from create_user.php that should be populated with user information and should show up [however it does not]. WHAT AM I DOING WRONG HERE?????? PLEASE LET ME KNOW. THANKS IN ADVANCE. I AM USING LOCALHOST.. __________________________________________________ CONNECT.PHP: __________________________________________________________________ <?php $database_host = "localhost"; $username = "php1"; $password = "jack"; $database_name = "user"; //require_once 'app_config.php'; mysql_connect($database_host, $username, $password) or die ("<p>Error connecting to database: " . mysql_error() . "</p>"); header("Location: show_user.php?user_id=" . mysql_insert_id()); // exit(); //echo "<p>Connected to MySql!!!!!</p>"; mysql_select_db($database_name) or die("<p>Error selecting the database user: " . mysql_error() . "</p>"); exit(); //echo "<p>Connected to Mysql, using database USER.</p>"; /* $result = mysql_query("SHOW DATABASES;"); if (!$result) { die("<p>Error in listing tables: ". mysql_error() . "</p>"); } echo "<p>Table in database:</p>"; echo "<ul>"; while ($row = mysql_fetch_row($result)) { echo "<li>Table: {$row[0]}<li>"; } echo "</ul>" */ ?> ____________________________________________________________________________ CREATE_USER.PHP __________________________________________________________________________________________________ <?php require_once 'connect.php'; $first_name = trim($_REQUEST['first_name']); $last_name = trim($_REQUEST['last_name']); $email = trim($_REQUEST['email']); $facebook_handle = trim($_REQUEST['facebook_handle']); $twitter_handle = trim($_REQUEST['twitter_handle']); $bio= trim($_REQUEST['bio']); $insert_sql = "INSERT INTO user (first_name, last_name, " . "email, facebook_handle, twitter_handle, bio) " . "VALUES ('{$first_name}', '{$last_name}', '{$email}', " . "'{$facebook_handle}', '{$twitter_handle}', '{$bio}');"; mysql_query($insert_sql); // $user_id = $_REQUEST['user_id']; header('Location: show_user.php?user_id=' . mysql_insert_id()); // $user_id = $_REQUEST['user_id']; // exit(); // or die(mysql_error()); ?> _______________________________________________ INDEX.HTML _______________________________________________________________________ <!-- To change this template, choose Tools | Templates and open the template in the editor. --> <!DOCTYPE html> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <div id="header"><h1>PHP & MYSQL: uuuuuuuuuuuu</h1> </div> <div id="content"> <form action="create_user.php" method="POST" enctype="multipart/form-data"> <fieldset> <label for="first_name">First Name:</label> <input type="text" name="first_name" size="20" /><br /> <label for="last_name">Last Name:</label> <input type="text" name="last_name" size="20" /><br /> <label for="email">Email Address:</label> <input type="text" name="email" size="20" /><br /> <label for="facebook_handle">Facebook Handle:</label> <input type="text" name="facebook_handle" size="20" /><br /> <label for="twitter_handle">Twitter Handle:</label> <input type="text" name="twitter_handle" size="20" /><br /> <label for="user_pic">Upload a Picture:</label> <input type="file" name="user_pic" /></br> <label for="bio">Bio:</label> <textarea name="bio" cols="40" rows="10"></textarea> </fieldset> <br/> <fieldset class="center"> <input type="submit" value="Join the Club" /> <input type="reset" value="Clear and Restart" /> </fieldset> </form> </div> </body> </html> _____________________________________ SHOW_USER.PHP _________________________________________________________________ //require_once 'create_user.php'; require_once 'connect.php'; $user_id = $_REQUEST['user_id']; $select_query = "SELECT * FROM user WHERE user_id = " . $user_id; $result = mysql_query($select_query); if ($result) { //get the query result rows using $ result $row = mysql_fetch_array($result); $first_name = $row['first_name']; $last_name = $row['last_name']; $bio = $row['bio']; // $email = $row['email']; // $facebook_handle = $row['facebook_handle']; // $twitter_handle = $row['twitter_handle']; } else { die ("Error locating user with ID {$user_id}"); } ?> <html <head> // user end up here by using the create_user.html and create_user.php. //also my loggin in and clicking "my profile". //selecting a particular user from a list. </head> <body> <div id="header"><h1>The first creatative site phil morales</h1></div> <div id="example">User Profile</div> <div id="contect"> <div class="user_profile"> <h1><?php echo "{$first_name} {$last_name}"; ?></h1> <p><img src="<?php echo $user_image; ?>" class="user_pic" /> <?php echo $bio; ?></p> <p class ="contact_info">Get in touch with $first_name:</p> </div> </div> </body> </html>
  3. Developing CART for Online Shopping I am trying to add buttons on html page and the code is working............I have some products in <SELECT> tag i.e. Product 1,Product 2,Product 3,Product 4,Product 5......... I create an array "list_array" and storing all the values in array dynamically... I click on <BUTTON>ADD </BUTTON> and it reads the value from <SELECT> tag and add it into array...........To display all the products, I execute the loop and display all the items in array with a <BUTTON>REMOVE</BUTTON> in-front of every product.......... To delete the particular product, I can select it in <SELECT> tag and then click on delete button..........It removes the element from array .........To display the cart, I am using the loop again, and it shows all the products after clicking the <BUTTON>Display</BUTTON> Now the issue that I am facing here is that I am adding <BUTTON>REMOVE</BUTTON> button when I am displaying the products that have been added in CART, the code of java_script is listed below function display() { string = ""; str=""; for(j=0;j<i;j++) { str = list_array[j]+"_"+j; string = list_array[j]+" <button onclick='remove_me(this)' id="+str+">Remove</button><br>"+string; } document.getElementById('write').innerHTML = "Array:<br> " + string; document.getElementById('i_val').innerHTML = "I: " + i; } Now, I am trying every way to make a code that will help me in removing the product by clicking on <BUTTON>REMOVE</BUTTON>, I hope I have explained everything here, so, help me to fix this issue...............
  4. I have a div I use for dialogs and I want to pass a string to the div and then show the specific twig template as an include. The div dialog is displayed without the template embedded, What am I doing wrong, is there a better way to do it? $('#new').click( function() { var str = " {% include 'catalogue_form.html' %} "; $('#dialog').text(str).html(); showDialog(); }); function showDialog() { $('#dialog_wrapper').fadeIn(); $('#dialog').fadeIn("slow"); } Thanks in advance, James
  5. Hi, I'm turning a 2 level nav into a 3 level and running into a few difficulties. The 3rd level displays where and as predicted but when the 'grandparent' is hovered over, not the parent of the items I want displayed. I've been fooling around with the css for a while and I cannot get it to respond how I'd like. Any help is appreciated. There is a fiddle as my explanation might be somewhat lacking. http://jsfiddle.net/6TGaf/ Code from fiddle: #nav{ background: #bada55; width: 99%; margin-top:-5px; } #nav ul{ list-style: none; margin: 0; padding: 0; height: 40px; } #nav ul li{ /*child elements positioned absolutley will be relative to this*/ position: relative; border-top: 1px solid #e9e9e9; float: left; } #nav a{ color: ghostwhite; padding: 12px 0px; /*fill hori space*/ display: block; text-decoration: none; /*apply transition to background property, taking 1s to change it */ transition:padding 1s, background 1s; -moz-transition:padding 1s, background 1s; -webkit-transition:padding 1s, background 1s; -o-transition:padding 1s, background 1s; font-family:tahoma; font-size:13px; text-transform:uppercase; padding-left:20px; } /*hover pseduo class*/ #nav a:hover{ /* RGBA background for transparancy: last number(0.05) is the transparency */ padding-left:35px; background: RGBA(255,255,255,0.05); color:#fff; } #nav ul li:hover ul{ /*diplay when hovered*/ display: block; } #nav ul ul{ position: absolute; left: 0px; top: 40px; border-top: 1px solid #e9e9e9; display: none; /*width: 304px;*/ z-index: 1; } #nav ul ul li{ width: 150px; background: #f1f1f1; border: 1px solid #e9e9e9; border-top: 0; /*float:left;*/ } #nav ul ul li a{ color:#000000; font-size:12px; text-transform:none; } #nav ul ul li a:hover { color:#929292; } /*3rd level...*/ #nav ul ul ul{ position: absolute; left: 150px; top: 0px; border-top: 1px solid #e9e9e9; display: none; /*width: 304px;*/ z-index: 1; } #nav ul ul ul li{ width: 150px; background: #f1f1f1; border: 1px solid #e9e9e9; border-top: 0; } #nav ul ul ul li a{ color:#000000; font-size:12px; text-transform:none; } #nav ul ul ul li a:hover { color:#929292; } #nav ul ul li:hover ul{ /*diplay when hovered*/ display: block; } <nav id = "nav"> <ul> <li> <a href="#">1.1</a> <ul> <li> <a href="#">1.1.1</a> <ul> <li><a href="#">1.1.1.a</a></li> <li><a href="#">1.1.1.b</a></li> </ul> </li> <li><a href="#">1.1.2</a></li> <li><a href="#">1.1.3</a></li> </ul> </li> </ul> </nav>
  6. I am working on a code that will help me in creating and maintaining the session on webpage. When the customer visits the page the session must become active and increase the counter by one. I am able to do that. But, when the customer visits that page again, session_start() has been called again and it provided a warning. Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\index.php:13) in C:\xampp\htdocs\counter.php on line 2 so, what can I do to omit this warning After visiting the page the session gets created and it does not updates further but it gives the above listed warning , looking for a quick answer .................
  7. I have this array that has n elements ---> list_array = new Array(); it contains ['Product 1','Product 2','Product 3','Product 4','Product 5','Product 6','Product 7','Product 8'] what I am trying to do is that starting a loop from j=0 to j<n, I am adding button on html page, now when I click on button, it must remove itself from the page. I want to do this with the help of javascript...Is there anyone who can help ??? If I click on "product 8", the page must display other 7 buttons and it must delete the button itself on the page..... function create() { for(j=0;j<i;j++) { "<button onclick='remove_me(this)' id="+list_array[j]+">Remove</button><br>"; } } function remove_me(obj) { _button = obj.id; remove(_button); } I am trying to perform this operation, however, it only receive "Product" in obj.id.............It skips the text after the first whitespace..... I hope that you got my concern, looking for quick reply.......
  8. Hi guys, I have a relatively hard question. The problem is that I must leave the HTML code as it is and not put any divs around the image tags. How can I add a class or a selector to an image tag so that I can style that specific image tag for a specific style sheet. The reason why I'm doing this is because my code is styled in three different style sheets for responsive web design. I need a way to select these image tags using an identifier without affect the html code to go crazy in other layouts. <img src="./ajaxfiles/globebuttons/1xtremevision.png" alt="" name="btn3" id="btn3" onclick="MM_swapImage('car','','./ajaxfiles/carbackgrounds/XtremeVision-E-City.jpg','btn1','','./ajaxfiles/globebuttons/1standardreplacement.png','btn2','','./ajaxfiles/globebuttons/1powervision.png','btn3','','./ajaxfiles/globebuttons/xtremevision.png','btn4','','./ajaxfiles/globebuttons/1bluevisionultra.png','btn5','','./ajaxfiles/globebuttons/1crystalvision.png','btn6','','./ajaxfiles/globebuttons/1diamondvision.png',1)" /> Any help would be much appreciated, please post a way to style these image tags ? All the best, Adam
  9. How to make effective and professional templates in HTML and CSS ? I do it manually and by writing scripts and codes, is there any other way out without using and designing tools ? If one can design effectively with tool, please tell the tool name here ...........
  10. Navigation menu hover for contact is correct in chrome but not in Firefox. See the contact us link onhover at last in menu In firefox the hover is not completely white If i increase padding for ".menu_bar ul li:first-child a" menu comes down I dont know where is the problem. My Link: http://72.29.85.214/~smartweb/teamwork/VPR025/index.php
  11. site http://allar.cmccd.net html <style type="text/css"> @import url("template.css"); </style> <div class="root"> <div class="header-wrap"> <div class="header"> <?php print render($page['header']); ?> </div> </div> <div class="subheader-wrap"> <div class="subheader"> <div class="nav-border-left"></div> <div class="nav-wrap"> <div class="navlink"> <?php if (isset($logo)): ?> <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo" class="logo"> <img src="<?php print $logo; ?>" alt="Jean & Tony’s Place a family website" height="50px" width="150px"/> </a> <?php endif; ?> <?php print theme('links', array('links' => $main_menu))?> </div> </div> <div class="nav-border-right"></div> </div> </div> <div class="body-wrap"> <div class="body"> <div class="content-border-left"></div> <div class="content-wrap"><?php print render($page['content']); ?></div> <div class="content-border-right"></div> </div> </div> <div class="subfooter-wrap"> <div class="subfooter"> <div class="subfooter-border-left"></div> <div class="subfooter-content-wrap"></div> <div class="subfooter-border-right"></div> </div> </div> <div class="footer-wrap"> <div class="footer"><?php print render($page['footer']); ?></div> </div> </div> css: .header-wrap, .subheader-wrap, .body-wrap, .subfooter-wrap, .footer-wrap {float:left; width:100%; clear:both; background:#000;} .header, .subheader, .nav, .body, .subfooter, .footer {width:1100px; margin:0 auto;} .body {float:none;} /* needs a height*/ .header {height:50px; width:960px;} .nav-border-left {float:left;celar:both; height:70px; width:70px; background:url(files/images/topleft-wire.png) no-repeat right;} .nav-wrap{float:left;celar:both; width:960px;height:70px;} .nav-border-right {float:left;celar:both;height:70px; width:70px; background: url(files/images/topright-wire.png) no-repeat;} .content-border-left {float:left;clear:left; height:100%; width:70px; background:url(files/images/left-wire.png) repeat-y;} .content-wrap{float:left;width:960px; color:#FFF; font-family:Lucida Grande, Verdana, sans-serif;} .content-border-right {float:left;clear:right; width:70px; background:url(files/images/right-wire.png)repeat-y;} .subfooter {height:70px;} .subfooter-border-left {float:left;celar:both; height:70px; width:70px; background:url(files/images/bottomleft-wire.png) no-repeat right;} .subfooter-content-wrap{float:left;celar:both; width:960px;height:70px; background:url(files/images/bottom-wire.png);} .subfooter-border-right {float:left;celar:both;height:70px; width:70px; background: url(files/images/bottomright-wire.png) no-repeat;} .links{margin:0;padding:0;} .navlink {} .navlink li {display:inline;} .navlink a {float:left; height:33px;font-weight:bold;line-height:32.75px; 'Times New Roman', Times, serif; font-size:16px;padding:0 25px; color:#FFF;text-align:center; border-right:1px solid #FFF;text-decoration:none; text-shadow:0px 1px 0px #185edf;} .navlink a:hover {background:url(/sites/all/themes/ssccix/files/nav-arrow.png) no-repeat center top; text-decoration:none;} .navlink a.active {background:#FFF; no-repeat center top;color:#091342;} .footer {} /*.border-left {float:left;height:100%;clear:left; width:2px; background:#fff;} .content-wrap{float:left;height:100%; width:960px; background:#555;} .border-right {float:left;height:100%;clear:right; width:2px; background:#fff;} */ The problem is that as you see the site the content is pushed to the left and the white borders on the left and right disappear, though they will show up if i have a pre-set height in the .body{} but than it will not auto height for the text. any ideas on the problem?
  12. I'll admit it upfront: I am a total noob to this, so please bare with me. I'm trying to create a simple PHP program with an HTML form to submit an input into PHP which then echos back the user's input but I keep getting an "Object not found!" error when I push the submission button on the page. If you could please tell me what I'm doing wrong, I would really appreciate it. My code is: <form action="index.php" method="post"> <input type="text" name="user_input" size="20"> <input type="submit" name="press" value="Press da button!"> </form> <?php if (isset($_POST['user_input'])) { $post= $_POST['user_input']; echo "You posted $post ."; } ?> Again, thanks a ton.
  13. Hello, I'm a beginner php developer so I might sound stupid x.x I'm working on a website on my local computer using xampp and the website is fine. But then when I tried runing the website online using a webhost (000webhost) I got two errors. the errors: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/assasasas/public_html/index.php on line 15 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/sasaasas/public_html/index.php on line 21 the code where the errors are: <?php if(isset($_GET['page'])) $page = intval($_GET['page']); else $page=1; $max=9; $from=($max*$page)-$max; $db_games_t_t = mysql_num_rows(mysql_query("SELECT * FROM games ORDER BY id DESC")); //line 15 $db_games_q = mysql_query("SELECT * FROM games ORDER BY id DESC LIMIT $from,$max"); $db_games_t = mysql_num_rows($db_games_q); $pages = ceil($db_games_t_t/$max); $count=0; while($r = mysql_fetch_array($db_games_q)) { //line 21 $count++; ?>
  14. </html> <script type="text/javascript"> var inc = 10; function move_down() { bar = document.getElementById('tarea'); inc += 10; bar.scrollTop = inc; document.getElementById("write").innerHTML = inc; } function move_up() { bar = document.getElementById('tarea'); inc -= 10; bar.scrollTop = inc; document.getElementById("write").innerHTML = inc; } setInterval( function() { if(inc>=450) {move_up();} if(inc<450) {move_down();} } ,100); </script> <body> This is a code that will help in running data in the same loation, vertically <br> <br> <textarea rows="10" cols="20" id="tarea"> this is a text this is a text this is a text this is a text this is a text this is a text this is a text this is a text this is a text this is a text this is a text this is a text this is a text this is a text this is a text this is a text </textarea> <br><br> <button onclick="movedown()" id="tarea">Click here</button><br> <div id="write"></div> </body> </html> I am trying to make a auto scroll function in java script, however, I am unable to do it, can you help with the code and tell what is wrong with the code ....................
  15. I am trying to save images in my database from HTML form. I have written PHP code to accomplish this task. Its giving me the following error message,and not inserting data in the database. Kindly check it. Here i am sharing a excerpt from my code. I am using BLOB for image. /*------------------- IMAGE QUERY ---------------*/ $file =$_FILES['image']['tmp_name']; if(!isset($file)) { echo 'Please select an Image'; } else { $image_check= getimagesize($_FILES['image']['tmp_name']); if($image_check==false) { echo 'Not a Valid Image'; } else { $image =file_get_contents ($_FILES['image']['tmp_name'] ); $image_name =$_FILES['image']['name']; if ($image_query =mysql_query ("insert into product_images values (1,'$image_name',$image )")) { echo $current_id; //echo 'Successfull'; } else { echo mysql_error(); } } } /*----------------- IMAGE QUERY END ---------------------*/ <form action='insert_product.php' method='POST' enctype='multipart/form-data' ></br> File : <input type='file' name= 'image' > </form> Error Message
  16. I am trying to code something in Java-script, I am trying to "fade_in" image and "fade_out" image with Set_interval function, I am facing problem, help me @@@@@ <html> <script type="text/javascript"> var inc_bit =1e-2; function inc_change() { var s = document.getElementById('img'); document.getElementById('write').innerHTML = inc_bit; inc_bit = inc_bit + 1e-2; s.style.opacity = inc_bit; if(inc_bit>1e0) { setInterval(function() {dec_change();},100); } } function dec_change() { var s = document.getElementById('img'); document.getElementById('write').innerHTML = inc_bit; inc_bit = inc_bit - 1e-2; s.style.opacity = inc_bit; if(inc_bit<1e-2) { setInterval(function() {inc_change();},100); } } setInterval(function() {inc_change();},90); </script> <body onload="inc_change()"> <img src="pic1.jpg" height="200px" width="250px" id="img" style="opacity:0.0"/> <div id='write'></div> </body> </html>
  17. Hi all, I have a webpage which opens redeem.html. The page has an option which you can see in the URL given underneath. - Caltex starcash card promotion When clicking on the navigation bar "redeem" its opens redeem.html however I'd like it to select the first option "Caltex starcash car promotion" by default on click of redeem in the navigation bar. So at first the url looks like this: http://www.continentalpromotions.com.au/redeem.html and I want this : http://www.continentalpromotions.com.au/redeem.html# Click on the url and have a go at looking at the URL to understand what I want, I can't figure this one out right now on how to get the options to be selected already. Any help would be very much appreciated the code is listed underneath of the <div> containing the link. <div class="span4"><a href="#"><img id="promo1" src="img/Promotions/redeempage/CaltexCardredeem.png" onClick="changeimage()" width="284" height="261" border="0"></a><br> <br> </div>
  18. i have this code below as part of my entire Select option, <option value="Running Request |Running > 1 hour">Running Request |Running > 1 hour</option> everything works fine except that when i try to view the uploaded data it would have this result: Running Request |Running > 1 hour 1 hour' /> so the 1 hour is duplicated and would have /> in the end, im thinking it could be the > causing it but just cant get through it...please help...i need to remove the excess 1 hour' /> when I view the uploaded data...
  19. I am creating a clothing website and say for a color on the sidebar I want to be able to submit a form with 'onClick' that will refresh the page, which it already does but to keep the checkbox checked when doing so. Right now my code submits properly refreshing the page and displaying the right products but the check in the checkbox is gone. I need the check to stay. Here is my code $sidebar_color .= '<div id="sidebar"> <label><form action="?" method="REQUEST"> <input type="checkbox" name="color" value="'.$color.'" onClick="submit();" /> <font size="-2"> <a href="?color='.$color.'">'.$color.' ('.$row["COUNT(color)"].')</a> </font></form></label></div>'; Another problem is when the 'onClick="submit();"' refreshes the page and then I press back the checkbox is checked. I need it to be unchecked when I press back. Is this also possible? I have been at this for days and tried too many things to remember what I tried. I figure I need something like this if(isset($_REQUEST["color"])) echo "checked="checked"" but nothing seems to work for me. Anyone have any ideas how to fix the code?
  20. I am working on code that can run images from left to right when I click on hyperlink ?? The code is listed below, please help me out ... <script type="text/javascript"> var left3; function next1() { var str = document.getElementById('pic01'); var left2 = parseInt(str.offsetLeft); left3 = left2; } function next2() { left3 =left3 + 50; var st = left3+'px'; document.getElementById('pic01').offsetLeft=st; } </script> <body onLoad="next1()"> <img src="pic1.jpg" height="100px" width="120px" style="margin-left:125px;" id="pic01"/> <br><br> <a href="#" style="margin-left:100px" onClick="next2()">Next</a> <body>
  21. suppose, I have 3 websites on same web-space that I have, with folder one two and three........ now, my question is that how to link them to their domains........ In my home directory, there are 3 folders [one,two and three] and they have all websites and web-pages that I want to access on internet....I am looking for an answer.......... If I enter one.com, it must access the files located in one folder only If I enter two.com, it must access the files located in two folder only If I enter three.com, it must access the files located in three folder only
  22. The program MUST use functions to calculate the cost of the conference, and to calculate the cost of meals. The functions should return the calculated costs back to the main program. I am trying to use checkboxes to for the input.. Im new to all of this trying to get it right.. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> <style> body { color:black; font-size:20px; } h1 { color:orange; text-align:center; font-size:30px; } p { font-family:"Times New Roman"; font-size:20px; } </style> <title>MAJOR PROJECT 1 PHP </title> </head> <body> <h1>Nerd Roundup </h1> <form method = "POST" action = "http://localhost/Assignments php class/calculationprogress.php"> <fieldset> <label> Please type your first name: </label> <input type = "text" name = "fName" value = "" /> <br /> <label> Please type your Last name: </label> <input type = "text" name = "lName" value = "" /> <br /> Please type your city: <input type = "text" name = "city" value = "" /> <br /> Please type your State: <input type = "text" name = "state" value = "" /> <br /> Please type your Zipcode: <input type = "text" name = "zipCode" value = "" /> <br /> <label for="other">Anything else you want to add?</label> <textarea id="other" name="other"></textarea><br /> <fieldset> <legend>HOW MANY DAYS</legend> <input type = "checkbox" name = "chkOne" value = "100.OO" /><label>ONE DAY $100.00</label> <input type = "checkbox" name = "chkTwo" value = "175.00" /><label>TWO DAYS $175.00</label> <input type = "checkbox" name = "chkThree" value = "325.00" /><label>THREE DAYS $325.00</label> <br /> <fieldset> <legend>DO YOU WANT THE MEAL PLAN?</legend> <input type = "checkbox" name = "mealPlan" value = "mealPlan" /><label>YES</label> <input type = "checkbox" name = "" value = "no" /><label>NO</label> <br /> <br /> <h1>NERD TRACK</h1> <select name = "track"> <option value = "PROGRAMMING TRACK">PROGRAMMING TRACK</option> <option value = "NETWORKING TRACK">NETWORKING TRACK</option> <option value = "SECURITY TRACK">SECURITY TRACK</option> <option value = "WEB TRACK">WEB TRACK</option> </select> <button type = "submit"> place order </button> </fieldset> </form> </body> </html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> <head> <style> body { background-color:#FF00FF; } h1 { color:orange; text-align:center; } p { font-family:"Times New Roman"; font-size:20px; } h1 {text-align:center; } </style> <title>Assignment3</title> </head> <body> <h1>Personal Information </h1> <?php // define the variables $fName = $_POST["fName"]; $lName = $_POST ["lName"]; $city = $_POST ["city"]; $state = $_POST ["state"]; $zipCode = $_POST["zipCode"]; $other = $_POST ["other"]; $chkOne = $_POST["chkOne"]; $chkTwo = $_POST["chkTwo"]; $chkThree = $_POST["chkThree"]; $mealPlan = $_POST[""]; $confTotal = 0; $no_errors = TRUE; $total = 0; //begin form filter if (filter_has_var(INPUT_POST, "chkOne")){ print "<p>ONE DAY CONFERENCE</p> \n"; $total += filter_input(INPUT_POST, "chkOne"); } if (filter_has_var(INPUT_POST, "chkTwo")){ print "<p>TWO DAY CONFERENCE</p> \n"; $total += filter_input(INPUT_POST, "chkTwo"); } if (filter_has_var(INPUT_POST, "chkThree")){ print "<p>THREE DAY CONFERENCE</p> \n"; $total += filter_input(INPUT_POST, "chkThree"); } //end $total if (filter_has_var(INPUT_POST, "mealPlan")){ } if (filter_has_var(INPUT_POST, "noFood")){ } // do they want the meal plan $track = filter_input(INPUT_POST, "track"); // what conference track are they on if(empty($fName)) { $no_errors = FALSE; echo '***FIRST NAME FIELD REQUIRED***** <br />' ; } //get users first name if(empty($lName)) { $no_errors = FALSE; echo '****LAST NAME FIELD REQUIRED***** <br /> '; } // get users last name if(empty($city)) { $no_errors = FALSE; echo '****CITY FIELD REQUIRED***** <br /> '; } //get user city if(empty($state)) { $no_errors = FALSE; echo '***STATE NAME FIELD REQUIRED***** <br /> '; } //get user state if(empty($zipCode)) { $no_errors = FALSE; echo '****ZIPCODE FIELD REQUIRED***** <br /> '; } //get user zip code if(empty($other)) { $no_errors = FALSE; echo '****TEXT FIELD REQUIRED***** <br /> '; } //get user additional comments if ($no_errors == FALSE) { echo "<br> <a href='major1progress.html'>Go back to form</a>"; } // check the fields are all filled if not direct back to form page //beging function calculateCost function calculateCost() global $total; $total = filter_input (INPUT_POST, "total"); $mealPlan = filter_input (INPUT_POST, "mealPlan"); IF (! filter_has_var (INPUT_POST, "mealPlan" )){ && $total =="100" ,$confTotal = $total+= 50; } else if ($total=="175"){ $confTotal = $total +=75; } else if ($total =="225"){$confTotal = $total +=100; } //end function cacluclateCost //end if //1 to 1000 $confId = rand(1,1000); //generate conf id number if ($no_errors == TRUE) { print " <p> $fName $lName, <br />you have registered for Nerd Roundup 2013<br /> your planned track is $track<br /> <br /> You choose -confDay<br /> with -mPlan<br /> The total cost is: \$$confTotal <br /> I hear the climate around $zipCode is great this time of year. <br /> Please make sure to bring cash, or your credit card to pay for the conference on the first day<br /> Your additional comments are as follows: $other <br /> </p> <p>Your Nerd Roundup confirmation number is $confId .</p> <br /> \n"; } //check and see is the form filled out if it is then print stuff ?> </body> </html> //beging function calculateCost function calculateCost() global $total; $total = filter_input (INPUT_POST, "total"); $mealPlan = filter_input (INPUT_POST, "mealPlan"); IF (! filter_has_var (INPUT_POST, "mealPlan" )){ && $total =="100" ,$confTotal = $total+= 50; } else if ($total=="175"){ $confTotal = $total +=75; } else if ($total =="225"){$confTotal = $total +=100; } //end function cacluclateCost
  23. Hi friends I use this php code in order to create a simple html table from my data $start = 0; $end = $howmanyItemsOnArray; $split = 2; print "<table><tr>"; for($i = $start; $i < $end; $i++) { print "<td><a href=\"../../pages/".$pagesArray[$i]."\">".$clearPagesArray[$i]."</a></td>"; if(($i) % ($split) == $split-1){ print "</tr><tr>"; } } print"</tr></table>"; After the execution of the script i get this code <table><tr><td> <a href="../../pages/file01.html">File Title 01</a></td><td> <a href="../../pages/file02.html">File Title 02</a></td></tr><tr><td> <a href="../../pages/file03.html">File Title 03</a></td><td> <a href="../../pages/file04.html">File Title 04</a></td></tr><tr><td> <a href="../../pages/file05.html">File Title 05</a></td><td> <a href="../../pages/file06.php">File Title 06</a></td></tr><tr><td> <a href="../../pages/file07.html">File Title 07</a></td><td> <a href="../../pages/file08.html">File Title 08</a></td></tr><tr><td> <a href="../../pages/file09.html">File Title 09</a></td><td> <a href="../../pages/file10.php">File Title 10</a></td></tr><tr><td> <a href="../../pages/file11.html">File Title 11</a></td><td> <a href="../../pages/file12.html">File Title 12</a></td></tr><tr><td> <a href="../../pages/file13.html">File Title 13</a> </td></tr></table> Now what i want to for an application is store this html code to a string. Is this possible? I'm waiting for ideas.
  24. I am trying to build a calculator in PHP which uses a certain formula to come up with the results. I have a form which collects the numbers and then posts to a calc.php page which calculates the answer. Here is my HTML code <!DOCTYPE html > <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Calculator</title> </head> <body> <form action="calc.php" method="POST"> <input type="text" name="num1"> <input type="text" name="num2"> <input type="text" name="num3"> <input type="submit" value="Calculate"> <?php echo form_close();?> </form> </body> </html> Here is my PHP but I just am missing something. <?php function calculate($num1, $num2, $num3) { $data = array() ; $data['c'] = $num1 / 50; $data['b'] = $num2 / 12; $data['s'] = $num3 / 5; $data['p'] = $data['c'] + $data['b'] - $data['s']; if($data['s'] > 4) { $data['s']= 4; } return $data ; } if (isset($_REQUEST['value'])) //Additional checks should be done tho. { $num1 = $_REQUEST["num1"]; $num2 = $_REQUEST["num2"]; $num3 = $_REQUEST["num3"]; $data = calculate($num1, $num2, $num3) ; echo "{$data['c']} + {$data['b']} - {$data['s']} = {$data['p']}" ; } Thank you for all help in advance
  25. Hi, I am having a problem with this simple form and I can't see why the email is not showing the name and email fields. The email goes through fine and is recieved but just does not show the name and email field. Any thoughts? Thanks <?php $field_name = $_POST['cf_name']; $field_email = $_POST['cf_email']; $mail_to = ''; $subject = 'Email List Subscription from Toycraft visitor - '.$field_name; $body_message = 'From: '.$field_name."\n"; $body_message .= 'E-mail: '.$field_email."\n"; $headers = 'From: '.$field_name."\r\n"; $headers .= 'Reply-To: '.$field_email."\r\n"; $mail_status = mail($mail_to, $subject, $body_message, $headers); if ($mail_status) { ?> <script language="javascript" type="text/javascript"> alert('Thank you for your subscription.'); window.location = 'index.php'; </script> <?php } else { ?> <script language="javascript" type="text/javascript"> alert('Message failed. Please, send an email to studio@'); window.location = 'index.php'; </script> <?php } ?>
×
×
  • 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.