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. 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 .................
  2. 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.......
  3. 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
  4. 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 ...........
  5. 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
  6. 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?
  7. 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.
  8. 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++; ?>
  9. </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 ....................
  10. 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
  11. 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>
  12. 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>
  13. 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...
  14. 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?
  15. 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>
  16. 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
  17. 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
  18. 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.
  19. 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
  20. 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 } ?>
  21. Hi, I have a question that's bugging me really badly, I want to make it so that when I have a <img> tag, the source of that image is shortened to look something like this... <img src="../../image.jpg" alt="picture_1" /> But when I do this, it doesn't work. I've tried many methods and different combination but it doesn't seem to work, so I figured that It must be some kind of option in the apache .htaccess file? Help would be much appreciated, thanks.
  22. I have a table with some data. The user chooses how he wants the data in the table to be sorted in the user.php page. The table data are stored in my mysql database. Easy. However because the table is paginated i have a huge problem. Everytime i change the page, the sortment is lost. I used cookies. <form method="post" action="news_list.php" onchange="form.submit()"> <select name="sortid" > <?php $sort_array = array(' ','date desc','date asc','title desc','title asc') ; for($i=1; $i<5; $i++) { if($i ==$shortchoice ){ echo '<option selected="selected" value="'.$i.'">'.$sort_array[$i].'</option>'; } else { echo '<option value="'.$i.'">'.$sort_array[$i].'</option>'; } } echo '</select></form>'; ?> In the beggining of news_list.php, before the header i place this: <?php session_start(); setcookie('sortid', $_POST['sortid']); ?> Now i have a paginated sorted table that keeps in $_cookie['sortid'] the users sorting choise When i change the first page IN the table, the sortment is maintained, because the cookie keeps its value. After i browse more pages, more than two IN the sorted table, the cookie looses its value and the table loses it's sortment, it returns to the default sorting value Should i place <?php session_start(); setcookie('sortid', $_POST['sortid']); ?> in my user.php page or in news_list.php? I have tried both but the problem insists. How to maintain the cookie value? Please i have racked my brains to find a solution, and nothing seems to work. Any suggestions? HELP!!!
  23. The user chooses his year of birth. This is stored in my mysql database. Easy. <select name="year" > for ($year = 1960; $year <= 2030; $year++) { echo '<option value="'.$year.'"><h4>' .$year.'<h4></option>'; } </select> However when i hit submit the form resets to the first option of the list, in this example 1960. If the user chooses 2000 for example and hits submit, the valuse will be passed with post to the next php page, but when i return to this, his choise, 2000, is lost, and it will return to 1960. How can i maintain his option in the select field? Furthermore i want if the user wants to change his option and the select field shows all the options from 1960 to 2030 in a row, not mixed. I am stuck. It is very frustrating. Help!!!
  24. Hi, I am trying to build a table with counted results. My code works unless the count value is 0 (albeit there is likely a much cleaner way to do this and if you have time feel free to share your way) here is what I have: How do I get a count of 0 if the query returns no results? I should mention I get an empty table when the result is 0 <?php // Conection Info $con=mysqli_connect("localhost","*****","*****","*****"); // Check connection if (mysqli_connect_errno()) echo "Failed to connect to MySQL: " . mysqli_connect_error(); // Querys $c_nc_t1 = mysqli_query($con, " SELECT actcaseld, type, encdate, COUNT(type) AS c_nc_t1_type_count FROM `Stats` WHERE type='Type 1' AND actcaseld='New Client' AND encdate BETWEEN (SELECT bdate FROM `ReportRange` WHERE cf_id=1) AND (SELECT edate FROM `ReportRange` WHERE cf_id=1) GROUP BY type"); $c_nc_t2d = mysqli_query($con, " SELECT actcaseld, type, encdate, COUNT(type) AS c_nc_t2d_type_count FROM `Stats` WHERE type='Type 2 diet' AND actcaseld='New Client' AND encdate BETWEEN (SELECT bdate FROM `ReportRange` WHERE cf_id=1) AND (SELECT edate FROM `ReportRange` WHERE cf_id=1) GROUP BY type"); $c_nc_t2a = mysqli_query($con, " SELECT actcaseld, type, encdate, COUNT(type) AS c_nc_t2a_type_count FROM `Stats` WHERE type='Type 2 ADA' AND actcaseld='New Client' AND encdate BETWEEN (SELECT bdate FROM `ReportRange` WHERE cf_id=1) AND (SELECT edate FROM `ReportRange` WHERE cf_id=1) GROUP BY type"); $c_nc_t2ai = mysqli_query($con, " SELECT actcaseld, type, encdate, COUNT(type) AS c_nc_t2ai_type_count FROM `Stats` WHERE type='Type 2 ADA and Insulin' AND actcaseld='New Client' AND encdate BETWEEN (SELECT bdate FROM `ReportRange` WHERE cf_id=1) AND (SELECT edate FROM `ReportRange` WHERE cf_id=1) GROUP BY type"); $c_nc_t2i = mysqli_query($con, " SELECT actcaseld, type, encdate, COUNT(type) AS c_nc_t2i_type_count FROM `Stats` WHERE type='Type 2 Insulin' AND actcaseld='New Client' AND encdate BETWEEN (SELECT bdate FROM `ReportRange` WHERE cf_id=1) AND (SELECT edate FROM `ReportRange` WHERE cf_id=1) GROUP BY type"); // Output to html //Build Headers echo "<center><h3>Report for date range:</h3></center>"; echo "<table border='1' align='center'> <tr> <th></th> <th></th> <th>Type 1</th> <th>Type 2 Diet</th> <th>Type 2 ADA</th> <th>Type 2 ADA + Insulin</th> <th>Type 2 Insulin</th> </tr>"; //Build Data output to html while($row_c_nc_t1=mysqli_fetch_array($c_nc_t1) and $row_c_nc_t2d=mysqli_fetch_array($c_nc_t2d) and $row_c_nc_t2a=mysqli_fetch_array($c_nc_t2a) and $row_c_nc_t2ai=mysqli_fetch_array($c_nc_t2ai) and $row_c_nc_t2i=mysqli_fetch_array($c_nc_t2i)) { echo "<tr>"; echo "<td>Caseload</td><td>New Clients</td> <td><center>" . $row_c_nc_t1['c_nc_t1_type_count'] . "</center></td> <td><center>" . $row_c_nc_t2d['c_nc_t2d_type_count'] . "</center></td> <td><center>" . $row_c_nc_t2a['c_nc_t2a_type_count'] . "</center></td> <td><center>" . $row_c_nc_t2ai['c_nc_t2ai_type_count'] . "</center></td> <td><center>" . $row_c_nc_t2i['c_nc_t2i_type_count'] . "</center></td> "; echo "</tr>"; } echo "</table>"; // Close Connection mysqli_close($con); ?> Thank you in advance for your time and wisdom!
  25. Hello, I am working in PHP, on a page, I am requesting user to enter name, number, email address. After submit, the table must vanish and a message must be displayed on the same web page. <table> <tr> <td>Name</td> <td><input type="text" size="65" name="fname"></td> </tr> <tr> <td>Name</td> <td><input type="text" size="65" name="fname"></td> </tr> <tr> <td>Name</td> <td><input type="text" size="65" name="fname"></td> </tr> </table> I have written the table that I am using to display on the page. I want to display message "Your data has been submitted" after the user click submit button. Table must vanish and only the message must be there on the same page......
×
×
  • 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.