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. 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!!!
  2. 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!
  3. 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......
  4. In my main navigation bar there is a menu named category & item and it has two submenus which names are category and item respectively. I have only one page to display these two section. My page is category_item.php and it has two different tabs to display each sections. In this case it iscategory and item. So my problem is I need to open category and item tab when clicking on category and item links on the submenu. This is code from main navigation bar <li class="current"> <a>Category & Item</a> <div class="menu-container"> <div class="menu-link"> <a href="">Category</a> </div> <div class="menu-link current"> <a href="">Item</a> </div> </div> </li> This is from category_item.php page <div class="ui-widget-header ui-corner-top"> <ul> <li><a href="#tabs-1">My Category</a></li> <li><a href="#tabs-2">My Items</a></li> </ul> </div> <div id="tabs-1" class="tabs3"> my stuff... </div> <div id="tabs-21" class="tabs3"> my stuff... </div> Can I know is it possible to do? Thank you.
  5. <!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> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <?php if (filter_has_var(INPUT_POST, "bName") && filter_has_var(INPUT_POST, "gName") && filter_has_var(INPUT_POST, "bPart") && filter_has_var(INPUT_POST, "device")) { $bName = filter_input(INPUT_POST, "bName"); $gName = filter_input(INPUT_POST, "gName"); $bPart = filter_input(INPUT_POST, "bPart"); $device = filter_input(INPUT_POST, "device"); print <<< HERE <h2>$bName and $gName<br />Went up the hill<br /></h2> To Fetch a $device of water<br /> $bName fell down and broke his $bPart <br /> And $gName came tumbling after. </h2> \n HERE; } else { //create form for the input print <<< HERE <h3>Please fill in the blanks below, and I will tell you a story</h3> <form method = "post" action = "" > <fieldset> <label>Boys Name:</label> <input type = "text" name = "bName" /> <label>Girls Name</label> <input type = "text" name = "gName" /> <label>body part</label> <input type = "text" name = "bPart" /> <label>water holding device </label> <select name = "device"> <option value = "bucket">bucket</option> <option value = "cooler">cooler</option> <option value ="glass">glass</option> <option value = "sip">sip</option> </select> <input type="submit" value="submit"/> Tell me the story </fieldset> </form> HERE; } ?> //end if </body> </html> Above is my code, I cannot get it to run correctly, I am a newbie trying to work through a book before next semester so that I will not be so confused when the real stuff starts.. Please if you could explain where I have things wrong. Thank you webDevdea
  6. Hi all, So I have a page which uses mysql_query to select some variables from a table, and then produces an array in order to plot this information on a graph (data used for this depends on the unique id which is obtained by $_GET [‘mrn’]. This is all working fine. However, what I want to do now is include multiple copies of these graphs on a single page (graphs for different mrn’s). I tried to do this by including the files like this: <php $_GET[mrn] = "1"; include('graph.php'); ?> //some html <php $_GET[mrn] = "2"; include('graph.php'); ?> The problem with this method has been that although it works once, the second you include a second graph it stops working (presumably because I have tried to assign two different values to the same variable by effectively defining it twice?) My question is therefore, is there some way to include a file, get its output (draw its graph), and then stop including it, so that I can start including the next file (drawing next graph). My reading so far has led me to believe there probably isn’t a way? Am I correct about that? Does anyone have any ideas about how I might get this working using a different technique? Thanks in advance for any help, Matt
  7. I am working on a site where the user clicks on a video to watch. When clicked I want to redirect them to a registration form that basically asks name, email and a password. The password is predetermined by the company I work for and are sent to the users. They do not create their own passwords, this not a login system it is just to verify what users are watching the video. after they enter their information and the password is verified it goes to the video. I know how I could do this for each individual video but that would create 100's of registration forms. I am looking for a way to use 1 form to check the passwords in the database and continue on. Any suggestions? I am a novice at PHP. (in reality, I wanted to use a real login system, but my boss didn't , so I am having to work in the constraints of the boss's wishes)
  8. I'm pretty new to front-end development and I'm finding myself in a right pickle. This is how it should look by the end. Body <body> <div class="nav"> <div class="nav_container"> <ul> <li id="logo"><img src="images/logo.png" alt="FUCK"></li> <ul class="menu"> <!-- selection 1 start --> <li>Select a theme<span id="fuck"><img src="images/arrow.png" alt=">"/></span> <ul> <li><a href="#">Fuck</a></li> <li><a href="#">Fuck</a></li> <li><a href="#">Fuck</a></li> <li><a href="#">Theme</a> <ul> <li><img src="images/preview.png"></li> </ul> </li> </ul> </li> </ul> <!-- selection 1 end --> </ul> </div> </div> </body> CSS body { background: #e3e3e3; margin: 0 auto 0 auto; } .nav { float:left; background: black; width: 100%; height: 95px; margin: 0 auto; -moz-box-shadow: 0 0 8px rgba(0,0,0,.25); /* drop shadow */ -webkit-box-shadow: 0 0 8px rgba(0,0,0,.25); /* drop shadow */ box-shadow: 0 0 8px rgba(0,0,0,.25); /* drop shadow */ background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEyMTUgOTUiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxsaW5lYXJHcmFkaWVudCBpZD0iaGF0MCIgZ3JhZGllbnRVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giIHgxPSI1MCUiIHkxPSIxMjUlIiB4Mj0iNTAlIiB5Mj0iLTI1JSI+CjxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiMyMjIiIHN0b3Atb3BhY2l0eT0iMSIvPgo8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMzNTM1MzUiIHN0b3Atb3BhY2l0eT0iMSIvPgogICA8L2xpbmVhckdyYWRpZW50PgoKPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEyMTUiIGhlaWdodD0iOTUiIGZpbGw9InVybCgjaGF0MCkiIC8+Cjwvc3ZnPg==); /* gradient overlay */ background-image: -webkit-linear-gradient(bottom, #222 -25%, #353535 125%); /* gradient overlay */ background-image: linear-gradient(bottom, #222 -25%, #353535 125%); /* gradient overlay */ } .nav li { list-style: none; } .nav_container { /*background: white;*/ width: 960px; height: 50px; margin: 0px auto; } #logo { float:left; position: absolute; top: 24px; } .menu { color: #fff; /* text color */ font-family: "Source Sans Pro", sans-serif; font-weight: 200; font-size: 15px; float:left; display: inline; padding: 12px 320px; display:block; color:white; } ul.menu > li { background-color: #323232; /* layer fill content */ -webkit-box-shadow: 0 3px 0 rgba(0,0,0,.5); /* drop shadow */ padding-right: 10px; padding-left: 10px; height: 33px; line-height: 33px; -webkit-transition: background-color .3s; } ul.menu > li:hover { background-color: #282828; /* layer fill content */ -webkit-box-shadow: 0 3px 0 rgba(0,0,0,.5); /* drop shadow */ padding-right: 10px; padding-left: 10px; height: 33px; line-height: 33px; cursor: pointer; } ul.menu li ul { display: none; } ul.menu li:hover ul { display:block; } ul.menu li ul > li { text-align: center; width: 100%; background-color: #212121; } #fuck { padding-left: 15px; } ul.menu li ul li ul li { display:none; } ul.menu li ul li:hover ul li { display:block; } How it should look How it looks
  9. Hello...I'm new to this site and to html/php coding...As you can tell I'm trying to connect to and query my DB and return the results...Here is my search_percentage.php...Can someone please look this over and point me in the right direction... //Here is my HTML part <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Search Contacts</title> <style type="text/css" media="screen"> ul li{ list-style-type:none; } </style> </head> <p><body> //I'm not sure my action part is correct <center> <form method="post" action="search_percentage.php?go" id="searchform"> <table width="80%" border="1" cellpadding="10" cellspacing="0"> <tr><td>Work tickets evaluation percentages <select name="summary"> <option>summary</option> <option>High</option> <option>Medium</option> <option>Low</option> </select> <select name="status"> <option>status</option> <option>Completed</option> <option>Not Completed</option> </select> <div align="right"><input type="submit" value="Search"></div> </td></tr> </table> </form> </center> </body> </p> </html> //Here is my php part. <?php if(isset($_POST['submit']) && !empty($_POST['query'])){ $db=mysql_connect (" ", " ") or die ('I cannot connect to the database because: ' . mysql_error()); //-select the database to use $mydb=mysql_select_db(" "); if ((summary==High) && (status==Completed)){ $result_two = mysql_query("(SELECT I.priority AS priority, COUNT(*) AS items, ROUND(COUNT(*) / T.total * 100) AS percent FROM project as I, (SELECT COUNT(*) AS total FROM project WHERE status='completed') AS T WHERE status = 'completed' AND priority = 'High')" . $priority);} elseif ((summary==High) && (status==Not_Completed)){ $result_two = mysql_query("(SELECT I.priority AS priority, COUNT(*) AS items, ROUND(COUNT(*) / T.total * 100) AS percent FROM project as I, (SELECT COUNT(*) AS total FROM project WHERE status='not completed') AS T WHERE status = 'not completed' AND priority = 'Low')" . $priority);} elseif ((summary==Medium) && (status==Completed)){ $result_two = mysql_query("(SELECT I.priority AS priority, COUNT(*) AS items, ROUND(COUNT(*) / T.total * 100) AS percent FROM project as I, (SELECT COUNT(*) AS total FROM project WHERE status='completed') AS T WHERE status = 'completed' AND priority = 'Medium')" . $priority);} elseif ((summary==Medium) && (status==Not_Completed)){ $result_two = mysql_query("(SELECT I.priority AS priority, COUNT(*) AS items, ROUND(COUNT(*) / T.total * 100) AS percent FROM project as I, (SELECT COUNT(*) AS total FROM project WHERE status='not completed') AS T WHERE status = 'not completed' AND priority = 'Medium')" . $priority);} elseif ((summary==Low) && (status==Completed)){ $result_two = mysql_query("(SELECT I.priority AS priority, COUNT(*) AS items, ROUND(COUNT(*) / T.total * 100) AS percent FROM project as I, (SELECT COUNT(*) AS total FROM project WHERE status='completed') AS T WHERE status = 'completed' AND priority = 'Low')" . $priority);} elseif ((summary==Low) && (status==Not_Completed)){ $result_two = mysql_query("(SELECT I.priority AS priority, COUNT(*) AS items, ROUND(COUNT(*) / T.total * 100) AS percent FROM project as I, (SELECT COUNT(*) AS total FROM project WHERE status='not completed') AS T WHERE status = 'not completed' AND priority = 'Low')" . $priority);} while($row = mysql_fetch_array($result_two)) { echo $Not_Completed=$row['Not_Completed']; echo $Completed=$row['Completed']; echo $High=$row['High']; echo $Medium=$row['Medium']; echo $Low=$row['Low']; } } ?>
  10. I'm a little new to PHP, a little more familiar to SQL but I haven't been able to figure out how to send a boolean value from an html form to the SQL server. I've got the doNotContact in the database as a boolean value, and have a checkbox for the selection: <td>Do Not Contact: </td><td><input type="checkbox" name="doNotContact" value= "True"/></td><br /> But when I write the SQL statement, it fails to get a value. All other values (text/number) work perfectly, except for this, so if anyone has any suggestions - I would appreicate it.
  11. So I have a form that I've been developing. I originally got the code from htmlDrive.net and have been working on applying it. Basically, I need this HTML form to post to my PHP page and generate/send the posted content into an email. I have been able to get this to work great for single selections but not for multiple selection boxes. Here is my form: <form id="formElem" name="formElem" action="mediaForm.php" method="post"> <fieldset class="step"> <legend>Media Request</legend> <p> <label for="segment">Product Segment: </label> <select name="segment[]" size="4" multiple id="segment"> <option selected> </option> <option>Pedestrian</option> <option>Industrial</option> <option>Security</option> <option>Sensorio</option> </select> </p> <p> <label for="media">Select Media: </label> <select name="media[]" size="4" multiple id="media"> <option selected> </option> <option>Catalog</option> <option>Media Kit</option> <option>Technical Binder</option> <option>General Information CD</option> </select> </p> <p> <label for="print">Printed Publication </label> <input name="print" type="checkbox" id="print"> </p> <p> <label for="digital">Digital Publication </label> <input name="digital" id="digital" type="checkbox"> </p> </fieldset> <fieldset class="step"> <legend>Personal Info</legend> <p> <label for="company">Company: </label> <input id="company" name="company" placeholder="ABC Automatics" AUTOCOMPLETE = "on" /> </p> <p> <label for="title">Job Title: </label> <input id="title" name="title" placeholder="President" AUTOCOMPLETE = "on" /> </p> <p> <label for="firstName">First Name: </label> <input id="firstName" name="firstName" placeholder="John" AUTOCOMPLETE = "on" /> </p> <p> <label for="lastName">Last Name: </label> <input id="lastName" name="lastName" placeholder="Smith" AUTOCOMPLETE = "on" /> </p> <p> <label for="customerType">Customer Type: </label> <select name="customerType[]" size="4" multiple id="customerType"> <option selected> </option> <option>Wholesale</option> <option>Distributor</option> <option>Architect</option> <option>Technician</option> <option>Sales</option> <option>End User</option> <option>Other</option> </select> <br> </p> <p> If you do not know your type, please choose "Other." </p> </fieldset> <fieldset class="step"> <legend>Contact Info</legend> <p> <label for="email">Email: </label> <input id="email" name="email" placeholder="jsmith@ABC_Auto.com" type="email" AUTOCOMPLETE = "on" /> </p> <p> <label for="phone">Phone Number: </label> <input id="phone" name="phone" placeholder="xxx-xxx-xxxx" type="tel" AUTOCOMPLETE = "on" /> </p> <p> <label for="address">Address: </label> <input id="address" name="address" placeholder="123 Enterprise Ln" AUTOCOMPLETE = "on" /> </p> <p> <label for="city">City: </label> <input id="city" name="city" placeholder="City Name" AUTOCOMPLETE = "on" /> </p> <p> <label for="state">State: </label> <input id="state" name="state" placeholder="ST" AUTOCOMPLETE = "on" /> </p> <p> <label for="zipcode">Zipcode: </label> <input id="zipcode" name="zipcode" placeholder="12345" AUTOCOMPLETE = "on" /> </p> <p> <label for="country">Country: </label> <select id="country" name="country"> <option selected> </option> <option>United States</option> <option>Mexico / Latin America</option> <option>Canada</option> <option>Other</option> </select> </p> </fieldset> <fieldset class="step"> <legend>Comments</legend> <p> <label for="comments"></label> <textarea name="comments" id="comments" placeholder="Insert additional comments here"></textarea> </p> </fieldset> <fieldset class="step"> <legend>Confirm</legend> <p> Everything in the form was correctly filled if all the steps have a green checkmark icon. A red checkmark icon indicates that some field is missing or filled out with invalid data. In this last step the user can confirm the submission of the form. </p> <p class="submit"> <button id="registerButton" type="submit" value="submit">Submit</button> </p> </fieldset> </form> My PHP: <?php if(isset($_POST['email'])) { $email_to = "email@yoursite.com"; $email_subject = "Media Request Form"; $segment = $_POST['segment']; $media = $_POST['media']; $print = $_POST['print']; $digital = $_POST['digital']; $company = $_POST['company']; $title = $_POST['title']; $firstName = $_POST['firstName']; $lastName = $_POST['lastName']; $customerType = $_POST['customerType']; $email = $_POST['email']; $phone = $_POST['phone']; $address = $_POST['address']; $city = $_POST['city']; $state = $_POST['state']; $zipcode = $_POST['zipcode']; $country = $_POST['country']; $comments = $_POST['comments']; $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "Company: ".clean_string($company)."\n"; $email_message .= "Title: ".clean_string($title)."\n"; $email_message .= "Name: ".clean_string($firstName)." ".clean_string($lastName)."\n"; $email_message .= "Type: ".clean_string($customerType)."\n\n"; $email_message .= "Email: ".clean_string($email)."\n"; $email_message .= "Phone: ".clean_string($phone)."\n"; $email_message .= "Address: ".clean_string($address)."\n"; $email_message .= "City: ".clean_string($city)."\n"; $email_message .= "State: ".clean_string($state)."\n"; $email_message .= "Zipcode: ".clean_string($zipcode)."\n"; $email_message .= "Country: ".clean_string($country)."\n\n"; $email_message .= "Segment: ".clean_string($segment[])."\n"; $email_message .= "Media Type: ".clean_string($media)."\n"; $email_message .= "Printed Copy: ".clean_string($print)."\n"; $email_message .= "Digital Copy: ".clean_string($digital)."\n\n"; $email_message .= "Comments: ".clean_string($comments)."\n\n"; // create email headers $headers = 'From: '.$email."\r\n". 'Reply-To: '.$email."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); ?> <!-- include your own success html here --> Thank you for contacting us. We will be in touch with you very soon. <?php } ?> My multiple selectors are not showing up correctly. They are only outputting "array" for the content. Any help would be much appreciated! Thanks!
  12. I have searched everywhere for an answer, but I don't think I'm asking the question in the right way. I have two columns, but I need the elements to stack and cant seem to make anything work. I also want to add a background color to make the elements stand out. If you look at the image attached, it shows that the left column doesnt but up against the bottom of the element above it, it seems to align itsself to the right column. Appreciate any help. Thanks in advance <style type="text/css"> #showcase { width: 100%; margin-bottom: 20px; margin-top: 4px; vertical-align:top; } #showcase > div { width: 280px; float: left; border: 1px solid #ddd; padding: 5px; vertical-align:top; margin-left: 0px; } #showcase > div:first-child { margin-left: 0; vertical-align:top; } #showcase > div > div { float: right; margin-left: 8px; vertical-align:top; font: 12px arial, sans-serif; } #showcase > div > img:last-child { width: 150px; clear: both; margin-top:16px; margin-left:0px; vertical-align:top; } img.floatLeft { float: left; margin: 4px; } img.floatRight { float: right; margin: 4px; } </style> <div class="module" style="margin-top:0px;"> <div class="module-header"><h3>Product Spotlight</h3></div> </div> <div id="showcase"> <? while($row = mysql_fetch_array($products_showcase_query)): ?> <div> <span style="display: block;font-size:20px;line-height: 130%;margin-bottom:4px;"><?= $row['product_headline'] ?></span> <img src="../product_images/<?= $row['product_image'] ?>" style="width: 134px; float: left;" /> <div><div class="floatLeft"> <?= $row['product_summary'] ?> </div></div> <img src="../product_logos/<?= $row['product_logo'] ?>" /> </div> <? endwhile ?> <span style="display: block;clear:both;"></span> </div>
  13. Hi all, I found this nice php script which uses an iphone barcode scanner to return the barcode EAN number in a URL. I want to pass it to an HTML form on another webpage. Does anyone know how to do this? I suspect its pretty simple im just very new to PHP and HTML. Thanks in advance for any replies, Matt <?php $code = $_REQUEST['ean']; echo '<' . '?xml version="1.0" encoding="UTF-8" ?' . '>'; ?> <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>test barcode reader</title> </head> <body> <div> <h1>test barcode reader</h1> <?php if ( $code ) : ?> <p> The barcode was <?php echo htmlentities( $code ); ?> </p> <?php endif; ?> <p> <a href="pic2shop://scan?callback=http://www.meandeviation.com/test/iphone/barcode.php?barcode=EAN">read barcode</a> </p> <p> This web page is for iPhone users only and needs <a href=""http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=308740640&mt=8">pic2shop</a> installed (it is free), which allows third party web apps and iPhone apps to use its bar code reading software as a form of local web service. </p> </div> </body> </html>
  14. Hi all, I have very limited knowledge of HTML and SQL but I’m trying to create a web user interface to allow updating of medical records. The idea is to use an HTML web form to search a SQL database for a record based on a patient number, and return and display the patients name and date of birth, along with another form that can be used to enter a new record for that patient which could then update the database by adding this record. (ie would need to create a new database table with date, time and whatever data was input into the form (say 5 more fields). Im guessing that to do this one would need to pass the data using PHP somehow, but im afraid I don’t have enough knowledge of how. Can anybody help advise me on how to do this? Thanks in advance for any replies, Matt
  15. Thank you for your time. I am not sure where this really belongs the HTML, CSS, Application Design or one of the PHP topics. So I figured I would post here. In my search I have found topics that come close to my question but have not provided a fix for my issue. So I'm asking for help. That and I am a beggining Web Developer. Problem: the php includes I use are not displayed on web pages in subdirectories. If I add ../ to the php include so it is like this: <?php include ("../menu.php"); ?> on the newpage.php only some of the included files are shown on the page in the subdirectory. All links on the file newpage.php now act as though they were written <a href="../menu.php">link</a> and don't work. They are acctually written <a href="menu.php">link</a>. Directory & Files / index.php header.php footer.php menu.php <!-- contains all links for site --> style.css subdir/ newpage.php newpage.php include code <div id="links"> <?php include ("menu.php"); ?> </div> Question? How do I fix it so that the menu.php and other included files are shown on the subdir pages? How do I make the links properly reflect the location. Since absolute or relative pathing appears to muck it up. FYI: I do not have CLI access to the server. Only ftp access. Thanks again for any help you may provide.
  16. hey guys, im trying to create a website similar to craigslist and ebay except i dont know much about php, so far i have created a basic website using mostly only css and html and a little bit of javascript. but im having a hard time figuring out how to work with php is there anybody on here that would be interested in working together to build a website with me that could have the potential to make money if it is build right ?
  17. What I'm doing is dynamically creating a table that automatically calculates the due date (based off of original, single DB entry) and what I need to do NOW is interrupt the loop at a certain point to inject a payment from another table. Here's the code that I have: while($startdate <= $today) { if ($startdate <= $pmt_date) { echo '<tr><td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. date("m.d.Y", $startdate) . '</center></td>'; echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. "$" . $english_format_number = number_format($row["supportamount"], 2, '.',',') . '</center></td>'; echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>$0.00</center></td>';echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. $intacc . '</center></td>'; echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. $appint . '</center></td>'; echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. $appprinc . '</center></td>'; echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. $bal . '</center></td></td>'; $startdate = strtotime('+1 month', $startdate); } else { echo '<tr><td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. date("m.d.Y", $pmt_date) . '</center></td>'; echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>$0.00</center></td>'; echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. "$".$english_format_number = number_format($row2["pmt_amt"], 2, '.',',') . '</center></td>'; echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. $intacc . '</center></td>'; echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. $appint . '</center></td>'; echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. $appprinc . '</center></td>'; echo '<td style="border-bottom-color:#3105b0; border-bottom-style:dashed; border-bottom-width:thin;"><center>'. $bal . '</center></td></td>'; } } echo '</table>'; There's only one instance of what is needed being injected working, then it repeated continuously. What I need to do it have it only apply ONCE during that loop... possibly a foreach() statement? If so, how would I do that and have the $pmt_date array automatically generated and how would the table generate?
  18. Hiya i'm using a navigation menu with a submenu on just one item for my website and I want to customise it to simply add a | character (as a neat divider) after each menu item. I cant work out how to do it because every time i try to add it in it pushes the rest of menu items to the line below. html <ul id="navbar"> <li><a href="#">Home</a></li> <li><a href="#">About Us</a></li> <li><a href="#">Contact</a></li> <li><a href="#">Connections</a></li> <li><a href="#">Windowsill Apothecary</a></li> <li><a href="#">Wizards Ramblings</a></li> <li><a href="#">Vibrational Essences Range</a><ul> <li><a href="#">Furry Friends Essences</a></li><li> <a href="#">Good Vibrations Essences</a></li><li> <a href="#">Release Essences</a></li></ul> </li> <li><a href="#">Herbal Tinctures</a></li> </ul> css #navbar { margin-left: 1em; padding: 0; height: 2em; margin-bottom:0.3em;} #navbar li { list-style: none; float: left; } #navbar li a { display: block; padding: 3px 8px; background-color: #646F5E; color: #fff; text-decoration: none; font-family:Georgia, "Times New Roman", Times, serif; font-size:16px;} #navbar li ul { display: none; width: 13em; /* Width to help Opera out */ background-color: #646F5E; font-family:Georgia, "Times New Roman", Times, serif; font-size:14px;} #navbar li:hover ul, #navbar li.hover ul { display: block; position: absolute; margin: 0; padding: 0; } #navbar li:hover { TEXT-DECORATION: underline;} #navbar li:hover li, #navbar li.hover li { float: none; } #navbar li:hover li a, #navbar li.hover li a { background-color: #646F5E; border-bottom: 1px solid #fff; color: #ffffff; font-family:Georgia, "Times New Roman", Times, serif; font-size:14px;} #navbar li li a:hover { background-color: #646F5E; TEXT-DECORATION: underline;} Any ideas? Thank you kindly
  19. hey everybody ; i want to hide some tabs in the menu for users according to their privileges ; my table : user (id, name , pwd , state , histotic , report) state , historic and report ill take values : yes or no . and according to that if user 1 will have : state = yes , historic=no , report = no it means that in the menu the too tabs : historic and reort will be hidden . is it possible to do it in php ?? if it is any ideas how can i start it ?? thank u so much for helpin me
  20. I have been looking around to try and figure out why there is a big gap at the top of this slider and I really don't know how to get rid of it. <h1><span style="color: #3b853f;">WELCOME TO INSURED CARS</span></h1> One low cost, monthly payment with insurance included. Protecting the public from high premiums...... <div class="space" style="height: 5px;"></div> <h4><img class="alignnone size-large wp-image-1352" alt="revolution-tick" src="http://insuredcarsonline.com/wp-content/uploads/2013/01/revolution-tick1.jpg" width="19" height="20" /><span style="color: #000000;"> INSURANCE INCLUDED</span></h4> <h4><img class="alignnone size-large wp-image-1352" alt="revolution-tick" src="http://.com/wp-content/uploads/2013/01/revolution-tick1.jpg" width="19" height="20" /><span style="color: #000000;"> LOW INITIAL PAYMENT</span></h4> <h4><img class="alignnone size-large wp-image-1352" alt="revolution-tick" src="http://.com/wp-content/uploads/2013/01/revolution-tick1.jpg" width="19" height="20" /><span style="color: #000000;"> ROAD TAX AND SERVICING INCLUDED</span></h4> <h4><img class="alignnone size-large wp-image-1352" alt="revolution-tick" src="http://.com/wp-content/uploads/2013/01/revolution-tick1.jpg" width="19" height="20" /><span style="color: #000000;"> CURFEW FREE SAFE DRIVING AID</span></h4> <h4><img class="alignnone size-large wp-image-1352" alt="revolution-tick" src="http://.com/wp-content/uploads/2013/01/revolution-tick1.jpg" width="19" height="20" /><span style="color: #000000;"> COMPLETE DATA CONFIDENTIALITY</span></h4> <h4><img class="alignnone size-large wp-image-1352" alt="revolution-tick" src="http://.com/wp-content/uploads/2013/01/revolution-tick1.jpg" width="19" height="20" /><span style="color: #000000;"> GUARANTEED FIXED PRICE INSURANCE</span></h4> <h4><img class="alignnone size-large wp-image-1352" alt="revolution-tick" src="http://.com/wp-content/uploads/2013/01/revolution-tick1.jpg" width="19" height="20" /><span style="color: #000000;"> ACCIDENT PROOF POLICY</span></h4>
  21. Hi all! I am new so don't hate if I write something in a bad way. Thanks. I have a "logical captcha" which is like a quiz. Here is my code. I don't know what is wrong with it <?php $database_db="general"; $user_db="root"; $password_db="somepass"; $host_db="localhost"; $link = mysqli_connect($host_db, $user_db, $password_db, $database_db); if (mysqli_connect_errno()) { die ("couldnot connect: ".mysqli_connect_error()); exit(); } $answer = $_POST['answer']; if (array_key_exists("answer", $_POST) AND array_key_exists("question", $_POST)) { $id = intval($_POST['question']); $sql="SELECT question, answer FROM captcha WHERE question='$id' AND answer='".mysqli_real_escape_string($link, $answer)."'"; $result = mysqli_query($link, $sql) or exit('$sql failed: '.mysqli_error($link)); $num_rows = mysqli_num_rows($result); if($num_rows > 0) { header("Location: success.php"); } else { header("Location: error.php"); } exit; } else { $query = "SELECT id, question FROM `captcha` ORDER BY RAND() LIMIT 1"; if ($result = mysqli_query($link, $query)) { if ($row = mysqli_fetch_assoc($result)) { $id = $row["id"]; $question = $row["question"]; } } } ?> <html> <body> <form method="post"> <?php echo $question; ?><br /> <input type="hidden" name="question" id="question" value="<?php echo $id; ?>" /> <input type="text" name="answer" id="answer" /><br /> <input type="submit" name="submit" value="submit" /><br /> </form> </body> </html> So the problem is that it always redirects to error.php, even if I enter the right answer
  22. I have a form that has 2 dropdown lists (Diplomas, Fields), a submit button and an "Add" button that copies the selected values of the dropdownlists to some dynamically generated textboxes as long as the number of the textboxes is lower than 5 This is the code of the dipSecSelection.php file included inside the form: <!----------- The dipSecSelection File -------------> <div id="dipSecSelection"> <table> <tr> <td><label for="diplomes">Diplome:</label></td> <td> <select name="Diplomes" id="Diplomes"> <option value="na">--Diplome--</option> <option value="Technician">Technician</option> <option value="Master">Master</option> <option value="PhD">PhD</option> </select> </td> <td id="separator">|</td><!-- Separator --> <td><label for="secteurs">Secteur:</label></td> <td> <select name="Secteurs" id="Secteurs"> <option value="na">--Secteur--</option> <option value="Software Dev">Software Dev</option> <option value="Engineering">Engineering</option> <option value="Physics">Physics</option> </select> </td> <td> <a href="#" Onclick="addDipSec()" value="Add" class="button">Add</a> </td> </tr> </table> <table> <tr> <td><div id='DipTextBoxesGroup'></div></td> <td><div id='SecTextBoxesGroup'></div></td> </tr> </table> </div> <script type="text/javascript"> //Diplomas textBoxes!!! var counterdip = 1; var countersec = 1; function addDipSec(){ if(counter>5){ alert("Only 5 Diplomas allow"); return false; } var newTextBoxDiv = $(document.createElement('div')).attr("id", 'TextBoxDiv' + counterdip); newTextBoxDiv.after().html('<label>Diplome #'+ counterdip + ' : </label>' + '<input type="text" name="dipBox[]" id="textboxdip' + counterdip + '" value="" >'); newTextBoxDiv.appendTo("#DipTextBoxesGroup"); $('#textboxdip'+counterdip).val($('#Diplomes option:selected').html()); counter++; //Secteurs textBoxes if(countersec>5){ alert("Only 5 Setors are allowed"); return false; } var newTextBoxDiv = $(document.createElement('div')).attr("id", 'TextBoxDiv' + countersec); newTextBoxDiv.after().html('<label>Secteur #'+ countersec + ' : </label>' + '<input type="text" name="secBox[]" id="textboxsec' + countersec + '" value="" size="35">'); newTextBoxDiv.appendTo("#SecTextBoxesGroup"); $('#textboxsec'+countersec).val($('#Secteurs option:selected').html()); countersec++; alert(secBox[0].val); } </script> This is the php code: <form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="POST" enctype="multipart/form-data"> <?php include'includes/dipSecSelection.php'?> <?php if(isset($_POST['dipBox']) && isset($_POST['secBox'])){ if(!empty($_POST['dipBox'])&&!empty($_POST['secBox'])){ $dip= $_POST['dipBox']; $sec= $_POST['secBox']; $N = count($dip); for($i=0; $i < $N; $i++){ $add_AnnDipSec = "INSERT INTO annDipSec VALUES('$dip[$i]','$sec[$i]')"; if(mysqli_query($connection, $add_AnnDipSec)){ echo'Successfully Added to AnnDipSec'; }else{echo'Error while trying to insert into AnnDipSec';} } }else{echo"Dip and Sec were Empty";} } ?> <input type="submit" name="submit" value="Submit" class='button'> </form> Problem is that dipBox[] and secBox[] never get set and always return nothing so they never get inserted to the database table.
  23. I am very new to php and I have seen many posts on how to write to a csv file and several on how to fgetcsv data from a file, but none of it really makes sense and I cannot find a relevant example of what I am attempting to do. I know that most will say, use mySQL, but for this example, I really want to know how to use a csv as a data source. I have a php script that creates an image gallery from the folder that it is placed. It also gets and displays the embedded image attributes, filename, file dimensions, file size. Rather than display the file dimensions and file size, I want a corresponding csv file to display an image Category and other details from the csv. The full original php script can be viewed here: http://www.mahogan.com/gallery.txt The modified working model of this gallery can be viewed here: http://www.mahogan.com/sandbox/thumbs/gallery.php Here is a php script that gets the data from the csv: http://www.mahogan.com/sandbox/thumbs/gallery-fgetcsv.php echo "<html><body><table>\n\n"; $f = fopen("gallery-data.csv", "r"); while (($line = fgetcsv($f)) !== false) { echo "<tr>"; foreach ($line as $cell) { echo "<td>" . htmlspecialchars($cell) . "</td>"; } echo "<tr>\n"; } fclose($f); echo "\n</table></body></html>"; In my examples of the csv, this just prints the entire csv in an html table as in the file. What I do not understand is this: 1) How to Match the Filename with the thumbnail filename in the folder so that all the data in that row will stay with that filename. 2) How to assign/replace this csv data to print these in place of the image attributes. Any advice with using this CSV as a data source would be very appreciated as I really want to learn how to do this! Thanks!
  24. My drop down input doesn't pass the value to the next page correctly echo " <select name='NexternalStocker'> <option value='NULL'>Select</option> <option value='NULL'>-----</option>"; while ($row2 = mysql_fetch_assoc($result2)) { echo "<option value='$row2[external_Stocker]'>$row2[external_Stocker]</option>"; } echo " </select>"; Despite the drop down menu item appearing correctly on the page, "$_POST['Nexternal_Stocker'];" won't retrieve anything on the next page... can anyone give me any pointers?
  25. Hello: I am having a problem with making hyperlinks to link to the right location. What I want it to do is just add the filename to the end of the first part (C:\php\website\files\insertfilenamehere.jpg). instead, I get something like this: file:///C:/php/website%0Ciles/%7Bwin2010filebutton.png%7D. Why are % signs and more slashes showing up in my file path? Could anyone point me in the right direction as to why they are not showing up correctly? I would appreciate any help that can be given. while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo $row['file']; $inf= $row['file']; echo "<tr><td>"; echo $row['tfid']; echo "</td><td>"; echo $row['lname']; echo "</td><td>"; echo $row['fname']; echo "</td><td>"; echo "<a href=\"C:\php\website\files\{$inf}\">Link</a>"; echo "</td></tr>"; } echo "</table>"; .
×
×
  • 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.