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 have a table called tb_app with fields 'id','aic','batchcode','name' example table value: '1','0001','1','james'. As you can see there are three textboxes(name)(aic)(batchode). I want to show the value of aic and batchcode in their correspoding textboxes after typing the specific name in the textbox(name). The problem is when you type james in the textbox(name) it shows '00011' in the (aic)textbox and (batchcode)textbox...i want it to be '0001' in aic and '1' in the batchcode if i type james which is stored value in the table. html code: <form method="post"> <input type="text" name="names" id="query" onblur="getvalues()"/> <input type="text" name="aic" id="aic"/> <input type="text" name="batchcode" id="batchcode" /> </form> script code: <script type="text/javascript"> function getvalues() { var selname = $("input[name=names]:text").val(); $.ajax({ url: "getuserdata.php", data: {"selname":selname}, type: 'post', success: function(output) { $("#aic").val(output); $("#batchcode").val(output); } }); } </script> getuserdata.php page: <?php include('include/connect.php'); $selname = $_POST['selname']; $query = "SELECT * FROM tb_app WHERE tb_app.name RLIKE '$selname'"; $result = mysql_query($query) or die(mysql_error()); while($rows = mysql_fetch_array($result)){ echo $rows['aic']; echo $rows['batchcode']; } ?>
  2. hello guys just a quick question i have made a html form with php embedded. here is php code: how could i change the code if 1 of the inputs is'nt numeric then it would echo a message saying "insert numeric values" at the minute it echos that if all numeric values are entered. elseif(is_numeric($_POST['number1']) && is_numeric($_POST['number2']) && is_numeric($_POST['number3']) && is_numeric($_POST['number4'])){ echo "please insert number";
  3. okay i dont know where to put this topic, if it needs to be moved then please do so, I have been creating a mass mailer with this class, <?php class SimpleMail { private $toAddress; private $CCAddress; private $BCCAddress; private $fromAddress; private $subject; private $sendText; private $textBody; private $sendHTML; private $HTMLBody; public function __construct() { $this->toAddress = ''; $this->CCAddress = ''; $this->BCCAddress = ''; $this->fromAddress = ''; $this->subject = ''; $this->sendText = false; $this->textBody = ''; $this->sendHTML = true; $this->HTMLBody = ''; } public function setToAddress($value) { $this->toAddress = $value; } public function setCCAddress($value) { $this->CCAddress = $value; } public function setBCCAddress($value) { $this->BCCAddress = $value; } public function setFromAddress($value) { $this->fromAddress = $value; } public function setSubject($value) { $this->subject = $value; } public function setSendText($value) { $this->sendText = $value; } public function setTextBody($value) { $this->sendText = false; $this->textBody = $value; } public function setSendHTML($value) { $this->sendHTML = $value; } public function setHTMLBody($value) { $this->sendHTML = true; $this->HTMLBody = $value; } public function send($to = null, $subject = null, $message = null, $headers = null) { $success = false; if (!is_null($to) && !is_null($subject) && !is_null($message)) { $success = mail($to, $subject, $message, $headers); return $success; } else { $headers = array(); if (!empty($this->fromAddress)) { $headers[] = 'From: ' . $this->fromAddress; } if (!empty($this->CCAddress)) { $headers[] = 'CC: ' . $this->CCAddress; } if (!empty($this->BCCAddress)) { $headers[] = 'BCC: ' . $this->BCCAddress; } if ($this->sendText && !$this->sendHTML) { $message = $this->textBody; } elseif (!$this->sendText && $this->sendHTML) { $headers[] = 'MIME-Version: 1.0'; $headers[] = 'Content-type: text/html; charset="iso-8859-1"'; $headers[] = 'Content-Transfer-Encoding: 7bit'; // $headers[] .= 'Content-Transfer-Encoding: quoted-printable'; $message = $this->HTMLBody; } elseif ($this->sendText && $this->sendHTML) { $boundary = '==MP_Bound_xyccr948x=='; $headers[] = 'MIME-Version: 1.0'; $headers[] = 'Content-type: multipart/alternative; boundary="' . $boundary . '"'; $message = 'This is a Multipart Message in MIME format.' . "\n"; $message .= '--' . $boundary . "\n"; $message .= 'Content-type: text/plain; charset="iso-8859-1"' . "\n"; $message .= 'Content-Transfer-Encoding: 7bit' . "\n\n"; // $message .= 'Content-Transfer-Encoding: quoted-printable' . "\n\n"; $message .= $this->textBody . "\n"; $message .= '--' . $boundary . "\n"; $message .= 'Content-type: text/html; charset="iso-8859-1"' . "\n"; $message .= 'Content-Transfer-Encoding: 7bit' . "\n\n"; $message .= $this->HTMLBody . "\n"; $message .= '--' . $boundary . '--'; } $success = mail($this->toAddress, $this->subject, $message, join("\r\n", $headers)); return $success; } } } ?> now the problem is when ever gmail recives the image code , <img src="http://yourdomain.com/image.jpg" > it escapes them like this : <img src=\"http://yourdomain.com/image.jpg\" > and the image is not read how could i resolve this ???
  4. I am working on a project, that lets users register, upload a photo and have that photo as a profile image which then other users can view. I am not sure how to structure this. Here is how I would imagine the process goes. 1-During user registration, user mkdir to create a a new directory that uses the users email address for the name of this new directory. 2-Take users to a upload image page, if users dont upload one, then use a default image. 3-User uploads image. 4-Image gets stored into the directory, and the image name is sent to mysql database. 5-Echo image in users profile by using a SELECT query. 6-using an image tag, select directory name by echoing out the users email from the db, and echo the image name from the db at appropriate areas. Step 6 would kinda look like this: //Grab user email from db and set it to a variable, do the same for image name $user_email = $email_from_db; $user_image = $image_from_db; <img src="image/<?php echo=$user_email; ?>/<?php $user_image; ?> /> Not sure if this is how its done, or if this is a secure way, also I have no idea how I would let users upload an image. Can anyone give me some advice?
  5. I'm trying to set up what I thought would be an easy form with button. I want to get the registration information out of the form when someone fills it out and pays. Instead, clicking the button leads to a mess of bad information at the top of the PayPal page. I think I'm missing something that pulls the data out of the form when someone registers. Looking at some examples online, someone who has done this before could probably fix my code in a few minutes. I thought the HTML skills learned I learned in the mid/late 90s were adequate for this. Sorry for the wall of code, but I provided it below. I've spent hours to get to this point and made a bunch of changes from some other forums and it still drops and error. http://www.lifeatpathway.com/what-s-happening/mukti-5k-registration <form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="mukti5k" id="5k" onsubmit="this.target='paypal'; return UpdateForm(this);" > <table> <tbody> <tr> <td>First name:</td> </tr> <tr> <td><input type="hidden" name="on0" value="First Name" /> <input type="text" name="os0" size="30" /></td> </tr> <tr> <td>Last name:</td> </tr> <tr> <td><input type="hidden" name="on1" value="Last Name" /> <input type="text" name="os1" size="30" /></td> </tr> <tr> <td>Address:</td> </tr> <tr> <td><input type="hidden" name="on2" value="Address" /> <input type="text" name="os2" size="30" /></td> </tr> <tr> <td>City:</td> </tr> <tr> <td><input type="hidden" name="on3" value="City" /> <input type="text" name="os3" size="20" /></td> </tr> <tr> <td>State:</td> </tr> <tr> <td><input type="hidden" name="on3" value="State" /> <input type="text" name="os3" size="2" /></td> </tr> <tr> <td>Zip:</td> </tr> <tr> <td><input type="hidden" name="on3" value="Zip" /> <input type="text" name="os3" size="10" /></td> </tr> <tr> <td>Phone:</td> </tr> <tr> <td><input type="hidden" name="on3" value="Phone" /> <input type="text" name="os3" size="14" /></td> </tr> <tr> <td>Email:</td> </tr> <tr> <td><input type="hidden" name="on3" value="Email" /> <input type="text" name="os3" size="30" /></td> </tr> <tr> <td>Age:</td> </tr> <tr> <td><input type="hidden" name="on3" value="Age" /> <input type="text" name="os3" size="2" /></td> </tr> <tr> <td>Gender:</td> </tr> <tr> <td><input type="radio" name="gender" value="male" /> Male <input type="radio" name="gender" value="female" /> Female</td> </tr> <tr> <td>Race:</td> </tr> <tr> <td><input type="radio" name="race" value="5k" /> Mukti 5K <input type="radio" name="race" value="1m" /> Mukti 1 Mile Fun Walk</td> </tr> <tr> <td><input type="hidden" name="on1" value="Shirt Size" />Shirt Size: </td> </tr> <tr> <td><input type="radio" name="shirt" value="ys" /> Youth Small <input type="radio" name="shirt" value="ym" /> Youth Medium <input type="radio" name="shirt" value="yl" /> Youth Large <br /><input type="radio" name="shirt" value="as" /> Adult Small <input type="radio" name="shirt" value="am" /> Adult Medium <input type="radio" name="shirt" value="al" /> Adult Large <input type="radio" name="shirt" value="axl" /> Adult XL <input type="radio" name="shirt" value="axxl" /> Adult XXL</td> </tr> <tr> <td colspan="2" align="center"> <div> </div> <div><input type="checkbox" name="agree" value="agree_terms" /> By checking this box, I, intending to be legally bound for myself, my heirs, my executors and administrators, waive, release and discharge any and all rights and claims which I may have or which hereafter may arise from all claims of damage, actions, injury or death received in any manner before, during or after participation in the 2014 Pathway Church Mukti 5K and 1 Mile Run/Walk on Saturday, May 10, 2014. I shall abide by all decisions of race officials as final. I also release the sponsoring organizations and individuals from all legal responsibility or liability for the use of any photographs involving me for the purpose of advertising or reporting.</div> </td> </tr> </tbody> </table> <input type="image" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" alt="Register Now" align="middle" /> <input type="hidden" name="cmd" value="_xclick" /> <input type="hidden" name="business" value="mikejohnston5@gmail.com" /> <input type="hidden" name="return" value="http://www.lifeatpathway.com" /> <input type="hidden" name="currency_code" value="USD" /> <input type="hidden" name="bn" value="PP-ShopCartBF" /></form>
  6. Hello, everyone. Can anybody help me, i'm trying to populate an HTML table with numbers in clockwise order, starting from last cell in the table then spiralling to the center. User inputs number of rows and columns, table is generated, but i'm lost at populating cells with numbers in clockwise order. Here's the code so far: <html> <head> <style> table{ border-collapse: collapse; } table, td{ border: 1px solid black; } td{ width: 50px; } tr{ height:50px; } </style> </head> <body> <div id="input"> <form action="table.php" method="post"> Input number of rows :<br> <input type="text" name="row"><br> Input number of columns:<br> <input type="text" name="column"><br> <input type="submit" name="submit" value="Ok"> </form> </div> <div id="output"> <?php $i = 0; $j = 0; echo "<table>"; for ($col = 0; $col < $_POST['column']; $col++) { echo "<tr>"; for ($row = 0; $row < $_POST['row']; $row++) { echo "<td>"; $i++; $array[$j] = $i; echo $array[$j]; $j++; echo "</td>"; } echo "</tr>"; } echo "</table>"; ?> </div> </body> </html> Array is there because i thought i could populate the table in desired order from array. Any suggestions, directions or links will be appreciated. Please help.
  7. i know i can just redirect it with jquery ,js - client side, or using php - server side, but what is the fastest way to do that when the page is loading? let say i have users from the us, uk, canada - English language, French, German, Chinese... now where is the best place to detect the ip of the country and then give the user the interface in his language? second question, if the user want to change the language with a language buttons like: English, French, German, Chinese... what is the fastest way to do that again without redirect the page to another page? client side, server side or both. i can track the ip, i can redirect the page in more than one way, but i'm looking for the fastest way and that why I'm asking this.
  8. Hi, Somehow I downloaded an example, modified and uploaded to server, also connected to mysql database. Php properly is working here insertareg.php Im new to PHP, just only know very little and earning by changing example codes. Want to do this: Only ( 0,1,2,3) will be inserted into Trays column and cells of the Trays column should change according to the inserting values as this o - red 1 - orange 2 - yellow 3 - green With the color of the cell number also should be displayed in each cell of Trays column. Help modifying the code <html> <head> <title>Data of Sensor</title> </head> <body> <h1>Data from the temperature and moisture sensors</h1> <form action="add.php" method="get"> <TABLE> <tr> <td>P Line</td> <td><input type="text" name="temp1" size="20" maxlength="30"></td> </tr> <tr> <td>Trays</td> <td><input type="text" name="moi1" size="20" maxlength="30"></td> </tr> </TABLE> <input type="submit" name="accion" value="Grabar"> </FORM> <hr> <?php include("conec.php"); $link=Conection(); $result=mysql_query("select * from tempmoi order by id desc",$link); ?> <table border="1" cellspacing="1" cellpadding="1"> <tr> <td> P Line </td> <td> Trays </td> </tr> <?php while($row = mysql_fetch_array($result)) { printf("<tr><td> %s </td><td> %s </td></tr>", $row["temp1"], $row["moi1"]); } mysql_free_result($result); ?> </table> </body> </html>
  9. Hi there! I am trying to get a list of images in line with each other-- the only thing giving me trouble is the fact that I want the last picture to be randomly chosen from an array of images. Everything seems to work just fine except for the fact that the randomized image and the other images won't stay on the same line. In other words, I want the images to show up like this: xxxxxxrandom ..but it keeps showing up like this: xxxxxx random <html> <text><red><large><i>Processing may take up to five seconds. You will be redirected shortly.</i></large></red></text><p> <meta http-equiv="refresh" content="5;url=entries.php"> <img src="base.gif" width="10" height="36"/> <img src="base2.gif" width="10" height="36"/> <img src="base3.gif" width="10" height="36"/> <img src="base4.gif" width="10" height="36"/> <img src="base5.gif" width="10" height="36"/> <img src="base6.gif" width="10" height="36"/> <?php $pic = array('50.gif','100.gif','200.gif','250.gif','150.gif','300.gif'); shuffle($pic); ?> <?php for( $i = 0; $i < 1; $i++) echo "<li style=\"display: inline;\"> <img src=\"$pic[$i]\" width=\"27\" height=\"36\"> </li>"; ?> </html> Would anyone be able to tell me what I may be doing wrong? Thank you so much!
  10. So i have this code wich checks if my server is online: <?php $ip = "example.com"; //IP or web addy $port = "80"; //Port $sock = @fsockopen( $ip, $port, $num, $error, 2 ); //2 is the ping time, you can sub what you need //Since fsockopen function returns TRUE or FALSE we can just plug it into the IF/THEN statement. An IF/ELSE would have worked to if( !$sock ){ //Do this if it is closed echo( "offline" ); } if( $sock ){ //Do this if it is open echo( "online" ); fclose($sock); } ?> and i've got: <img class="img-circle" src="ico/online.png" alt="Server status"> I want to use the php script to change the image source in the html.I have an online.png and an offline.png image.I need to somehow change it and I don't know how. I am fairly new to php.
  11. Hey guys, i am just messing around with the float property and setting up a layout with 3 columns. i am trying to tie in this column layout between a header and footer. code: <!doctype html> <html> <head> <title>Responsive Image</title> <meta charset="utf-8"> <link href="css/demo.css" rel="stylesheet" type="text/css"></link> <script> document.cookie = "device_dimensions=" + screen.width + "x" + screen.height; </script> </head> <body> <div class="header"></div> <div class="left"></div> <div class="center"></div> <div class="right"></div> <div class="footer"></div> </body> </html> and the CSS body{ margin: 0px 0px; padding: 0px 0px; } .header{ height: 50px; width: auto; background-color: gray; } .left{ height: 500px; width: 180px; margin-left: 100px; border: black 3px solid; margin-top: 20px; float:left; } .center{ height: 500px; width: 700px; border: black solid 3px; float: left; margin-top: 20px; margin-left: 20px; } .right{ height: 500px; width: 200px; border: black solid 3px; float: left; margin-top: 20px; margin-left: 20px; margin-bottom: 20px; } .footer{ height: 50px; width: auto; background-color: black; } IMAGE OF FINAL PRODUCT I want the footer to box the content ( 3 columns ) with the header. any suggestions as to why the footer is foregoing the content and sticking to the header ?
  12. Hi everyone. I have another question, which will hopefully be the last piece to get my application going. I have a MySQL table with an enum field, with a few values (Value1, Value2, Value3, Value4). I have a HTML form that is pulling over fields from the same table, but those other fields are varchar fields. I'm wanting to create a drop down box which is dynamically populated with those enum values, and that defaults to the currently selected field. I have found a few examples of this, but they all seem to be deprecated mysql_* code, whereas I'm using mysqli_* throughout. I'm fairly new to PHP, and I have never written a function before. I figure something like this would be out there somewhere, but I haven't been able to find an example here at PHPFreaks, nor on various other forums. Here are some examples of what I have found using mysql_*: http://www.barattalo.it/2010/01/19/php-to-get-enum-set-values-from-mysql-field/ http://stackoverflow.com/questions/3715864/displaying-mysql-enum-values-in-php http://www.larryullman.com/forums/index.php?/topic/916-use-data-type-enum-for-form-drop-down-options/ http://www.pcserviceselectronics.co.uk/php-tips/enum.php I just don't know where to start with creating this function. I need to use this 3 times, or 2 different fields, which is why I assumed a function would be the best way to go. Thanks for any help!
  13. Hello, I'm trying to make a sliding bar or how you would describe it. And as the topic says, not a imageslider, where it takes a couple seconds before it changes picture.... I tried to come up with something in Paint to describe what I mean... A rolling bar so to say. I searched the webz like a maniac but only found sliders for images and other random stuff that isn't what I need, so I would hope someone of you guys might know how to do this. I'll attach the image. Thanks in advanced, peace!
  14. I am doing a search engine for free for a Autism site. I am having a problem with a php query returning an embedded link from a MySql db. The issue is it returns http://mysitename.com and then concatenates the link I had put in which is http://www.ada.com In the db Text field it is : <a href="http://www.ada.com" target="_blank">The Americans with Disabilities Act </a>was enacted in 1990 to establish the prohibition of discrimination.... Results are the link goes to http://www.mysitename.com/"www.ada.com" (Please notice the quotes as well). I don't know why it's putting in mysitename.com or why it's putting quotation marks around the real link or lastly why it's making my link a sub folder of mysitename.com. Pic of the results: Here is the code: <?php // create short variable names $searchtype=$_POST['searchtype']; $searchterm=trim($_POST['searchterm']); if (!$searchtype || !$searchterm) { echo '<p><strong>You have not entered search details. Please go back and try again.</strong></p>'; exit; } if (!get_magic_quotes_gpc()){ $searchtype = addslashes($searchtype); $searchterm = addslashes($searchterm); } @ $db = new mysqli("*","*","*","*"); if (mysqli_connect_errno()) { echo 'Error: Could not connect to database. Please try again later.'; exit; } $query = "select * from acronymns where ".$searchtype." like '%".$searchterm."%' ORDER BY title "; $result = $db->query($query); $num_results = $result->num_rows; echo "<p>Number of records found: ".$num_results."</p>"; for ($i=0; $i <$num_results; $i++) { $row = $result->fetch_assoc(); echo "<p><strong>".($i+1).". "; echo $row['acro']; echo " - "; echo $row['title']; echo "</strong><br />"; echo $row['desc']; echo "</p>"; } // $result->free(); $db->close(); ?> Thank you ahead of time.... this is really driving me nuts!
  15. Hello everyone, I am trying to create a database login but i am not having any luck. I am not sure what is wrong. I feel everything is in order but I am new and don't really know what to look for. If someone could help me get this up and running, i'd greatly appreciate it. I've spent over 20 hours. I know it isn't exteremely diffuclt but I am fustrated and about to give up . Some help would me great! 1st page: Login.html ( I left out the formatting, heres just the form) file:///C:/Users/Stahlsta/Desktop/PHP/Login.html <form name="form 1" method="post" action="KitchenDatabase.php"> <Center><table width="20%" border="0" cellspacing="0" bgcolor="blue" frame="box" > <tr> <td><h3>Username:</h3></td> <td><input name="username" type="text" id="username" ></td></tr> <tr> <td><h3>Password:</h3></td> <td><input name="password" type="text" id="password" ></td></tr> <tr> <td colspan="2" align="center"> <input type="submit" name="Submit" value="Login"/> <input type="submit" value="Guest Log in"/></td></tr> </table> </Center> </form> When I click login: I want to access KitchenDatabase.php 2nd page:KitchenDatabase.php - This page should link to loginsuccess.php <?php $host="localhost:3306"; // Host name $Owner_fName="username"; // Mysql username $Owner_password="password"; // Mysql password $db_name="2013-wstahl"; // Database name $tbl_name="Owner"; // Table name // Connect to server and select databse. mysql_connect("$host", "$Owner_fName", "$Owner_password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from form $Owner_fName=$_POST['username']; $Owner_password=$_POST['password']; // To protect MySQL injection (more detail about MySQL injection) $Owner_fName = stripslashes($Owner_fName); $Owner_password = stripslashes($Owner_password); $Owner_fName = mysql_real_escape_string($Owner_fName); $Owner_password = mysql_real_escape_string($Owner_password); $sql="SELECT * FROM $tbl_name WHERE username='$Owner_fName' and password='$Owner_password'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $username and $password, table row must be 1 row if($count==1){ // Register $Owner_fName, $Owner_password and redirect to file "loginsuccess.php" session_register("username"); session_register("password"); header("location:loginsuccess.php"); } else { echo "Wrong Username or Password"; } ?> Page 3:loginsuccess.php - This page should link to KitchenDatabase.html <?php session_start(); if(!session_is_registered(username)){ header("KitchenDatabase.html"); } ?> Page 4:I wont bore you witht he code, i dont think it's important for the login work. (file:///C:/Users/Stahlsta/Desktop/PHP/KitchenDatabase.html) Everything is based off this database. KitchenDatabase.sql # # DUMP FILE # # Database is ported from MS Access #------------------------------------------------------------------ # Created using "MS Access to MySQL" form http://www.bullzip.com # Program Version 5.1.242 # # OPTIONS: # sourcefilename=C:\Users\wstahl\Desktop\KBdatabase1.accdb # sourceusername= # sourcepassword= # sourcesystemdatabase= # destinationdatabase=2013-wstahl # storageengine=MyISAM # dropdatabase=0 # createtables=1 # unicode=1 # autocommit=1 # transferdefaultvalues=1 # transferindexes=1 # transferautonumbers=1 # transferrecords=1 # columnlist=0 # tableprefix= # negativeboolean=0 # ignorelargeblobs=0 # memotype=LONGTEXT # CREATE DATABASE IF NOT EXISTS `2013-wstahl`; USE `2013-wstahl`; # # Table structure for table 'Fridge' # DROP TABLE IF EXISTS `Fridge`; CREATE TABLE `Fridge` ( `Fridge_ID` INTEGER NOT NULL, `Owner_ID` INTEGER NOT NULL, `Room_Loc` VARCHAR(255), INDEX (`Owner_ID`), PRIMARY KEY (`Fridge_ID`), FOREIGN KEY (`Owner_ID`) REFERENCES `Owner` ) ENGINE=myisam DEFAULT CHARSET=utf8; SET autocommit=1; # # Dumping data for table 'Fridge' # INSERT INTO `Fridge` VALUES (100, 100, 'Kitchen'); INSERT INTO `Fridge` VALUES (101, 101, 'Wills'); INSERT INTO `Fridge` VALUES (102, 102, 'Taylors'); INSERT INTO `Fridge` VALUES (103, 103, 'Matts'); INSERT INTO `Fridge` VALUES (104, 104, 'Felixs'); INSERT INTO `Fridge` VALUES (105, 105, 'Anthonys'); INSERT INTO `Fridge` VALUES (106, 106, 'Sams'); # 7 records # # Table structure for table 'Guest' # DROP TABLE IF EXISTS `Guest`; CREATE TABLE `Guest` ( `Guest_ID` INTEGER NOT NULL AUTO_INCREMENT, `Guest_fName` VARCHAR(50), `Guest_lName` VARCHAR(50), `Over21` TINYINT(1) DEFAULT 0, `Owner_ID` INTEGER NOT NULL, INDEX (`Over21`), PRIMARY KEY (`Guest_ID`), FOREIGN KEY (`Owner_ID`) REFERENCES `Owner` ) ENGINE=myisam DEFAULT CHARSET=utf8; SET autocommit=1; # # Dumping data for table 'Guest' # INSERT INTO `Guest` VALUES (1, 'Harry', 'Potter', 1, 101); INSERT INTO `Guest` VALUES (2, 'Jamie', 'Kurtis', 1, 102); INSERT INTO `Guest` VALUES (3, 'Bucky', 'Smith', 0, 103); INSERT INTO `Guest` VALUES (4, 'Nick', 'Crawl', 1, 101); INSERT INTO `Guest` VALUES (5, 'Matt', 'Taylor', 0, 104); INSERT INTO `Guest` VALUES (6, 'Martha', 'Stewart', 1,105); INSERT INTO `Guest` VALUES (7, 'Kris', 'Durdon', 0, 105); INSERT INTO `Guest` VALUES (8, 'Mike', 'Micheals', 1, 102); # 8 records # # Table structure for table 'Item' # DROP TABLE IF EXISTS `Item`; CREATE TABLE `Item` ( `Item_ID` INTEGER NOT NULL AUTO_INCREMENT, `Item_Name` VARCHAR(255), `Item_Cost` DECIMAL(19,4), `Exp_Date` DATETIME, `Item_Qty` INTEGER, `Owner_ID` INTEGER, `Fridge_ID` INTEGER, `Store_ID` INTEGER, PRIMARY KEY (`Item_ID`), FOREIGN KEY (`Owner_ID`) REFERENCES `Owner`, FOREIGN KEY (`Fridge_ID`) REFERENCES `Fridge`, FOREIGN KEY (`Store_ID`) REFERENCES `Store`, INDEX (`Fridge_ID`), INDEX (`Owner_ID`), INDEX (`Store_ID`) ) ENGINE=myisam DEFAULT CHARSET=utf8; SET autocommit=1; # # Dumping data for table 'Item' # INSERT INTO `Item` VALUES (1, 'eggs', 2.09, '2013-11-11 00:00:00', 2, 100, 100, 200); INSERT INTO `Item` VALUES (2, 'milk', 3.49, '2013-11-07 00:00:00', 2, 100, 100, 201); INSERT INTO `Item` VALUES (3, 'Bread', 3.09, '2013-11-08 00:00:00', 1, 101, 101, 201); INSERT INTO `Item` VALUES (4, 'cheese', 4.01, '2013-12-30 00:00:00', 2, 101, 100, 200); INSERT INTO `Item` VALUES (5, 'hot dogs', .97, '2014-01-16 00:00:00', 3, 102, 102, 200); INSERT INTO `Item` VALUES (6, 'rolls', 3.09, '2013-11-25 00:00:00', 6, 102, 102, 200); INSERT INTO `Item` VALUES (7, 'noodles', .99, NULL, 4, 103, 103, 202); INSERT INTO `Item` VALUES (8, 'sauce', 4.09, '2013-11-20 00:00:00', 2, 103, 103, 202); INSERT INTO `Item` VALUES (9, 'rice', .98, NULL, 12, 104, 104, 200); INSERT INTO `Item` VALUES (10, 'beans', 1.49, '2013-12-18 00:00:00', 2, 104, 100, 202); INSERT INTO `Item` VALUES (11, 'hamburgers', 6.99, '2013-12-25 00:00:00', 8, 105, 100, 200); INSERT INTO `Item` VALUES (12, 'buns', 3.09, '2013-12-19 00:00:00', 8, 105, 105, 200); INSERT INTO `Item` VALUES (13, 'onions', .99, NULL, 3, 106, 106, 202); INSERT INTO `Item` VALUES (14, 'soup', 1.99, '2014-04-16 00:00:00', 5, 106, 106, 200); INSERT INTO `Item` VALUES (15, 'icream', 3.09, NULL, NULL, NULL, 101, NULL); INSERT INTO `Item` VALUES (16, 'Bacon', 5.15, '2013-10-16 00:00:00', 1, 101, 101, 202); INSERT INTO `Item` VALUES (17, 'Hot sauce', 2.79, '2013-11-22 00:00:00', 3, 101, 101, 200); INSERT INTO `Item` VALUES (18, 'ketchup', 3.5, NULL, 1, 101, 101, 201); INSERT INTO `Item` VALUES (19, 'crunch cereal', 3.49, '2014-01-22 00:00:00', 2, 101, 101, 201); # 19 records # # Table structure for table 'Owner' # DROP TABLE IF EXISTS `Owner`; CREATE TABLE `Owner` ( `Owner_ID` INTEGER NOT NULL, `Owner_fName` VARCHAR(255) NOT NULL, `Owner_lname` VARCHAR(255), `Owner_password` VARCHAR(50), PRIMARY KEY (`Owner_ID`) ) ENGINE=myisam DEFAULT CHARSET=utf8; SET autocommit=1; # # Dumping data for table 'Owner' # INSERT INTO `Owner` VALUES (100, 'All', 'NULL', 'NULL'); INSERT INTO `Owner` VALUES (101, 'Will', 'Stahl', password); INSERT INTO `Owner` VALUES (102, 'Taylor', 'Ryzuk', NULL); INSERT INTO `Owner` VALUES (103, 'Matt', 'Sheehan', NULL); INSERT INTO `Owner` VALUES (104, 'Felix', 'Burgos', NULL); INSERT INTO `Owner` VALUES (105, 'Anthony', 'Lombardi', NULL); INSERT INTO `Owner` VALUES (106, 'Sam', 'Gutzmer', NULL); # 7 records # # Table structure for table 'Store' # DROP TABLE IF EXISTS `Store`; CREATE TABLE `Store` ( `Store_ID` INTEGER NOT NULL, `Store_Name` VARCHAR(255) NOT NULL, `Store_City` VARCHAR(255), PRIMARY KEY (`Store_ID`) ) ENGINE=myisam DEFAULT CHARSET=utf8; SET autocommit=1; # # Dumping data for table 'Store' # INSERT INTO `Store` VALUES (200, 'Walmart', 'Oswego'); INSERT INTO `Store` VALUES (201, 'Bryne', 'Oswego'); INSERT INTO `Store` VALUES (202, 'Kinneys', 'Oswego'); INSERT INTO `Store` VALUES (203, 'Price Chopper', 'Oswego'); # 4 records Am I even close? I've come to far to quit. Please help me get this working Kudos, Fridge.html Fridge.php KitchenDatabase.html KitchenDatabase.php Login.html loginsuccess.php
  16. Hi all GURU's, I have a problem with UTF-8 characters when I post values/data from my MySQL database into the OPTIONs that I use when using a SELECT in my FORM. The PHP script files are in format UTF-8. The database, the tables and the columns are all set in UTF-8. The charset in the META-tag for the html output is set to UTF-8. All other text that is fetched from the database shows my characters (Swedish å ä ö) the right and correct way, EXCEPT when I echo the data in the OPTIONs in my SELECT box. What can I do? Sincerely, Andreas
  17. hi i was just wondering how i would go about keeping user input in a field if an error occurs e.g. if i accidentally type in a special character into my form it will display a message saying : is not aloud or something like that but once this is shown all user input is lost so they would have to type it in again, ive tryed going online and i cant seem to find anything that works as it comes up with undifiened index <input type="text" name="clientname" value="<?php echo htmlspecialchars($_post['clientname']);?> > aswell as this im really in need of a message that says success, ive got no clue how i would go about doing it. what i need is a message that says 'form submitted'once you press submit and when no errors occur. greatly apreciate anyone that can help
  18. hopefully this will be the end of this little project but ive been trying to do this for a while now i need to get 2 different collumns one of which is hidden which will be the ID one has the value of the field e.g. test, im hopefully down to the last error. ( ! ) Warning: mysqli_fetch_row() expects parameter 1 to be mysqli_result, boolean given in C:\wamp\www\AddLeads\addeadstemplate.php on line 254 Call Stack # Time Memory Function Location 1 0.0000 186408 {main}( ) ..\addeadstemplate.php:0 2 0.0156 194880 mysqli_fetch_row ( ) ..\addeadstemplate.php:254 <tr> <td>Type of Business:</td> <td> <select name="typeofbusiness"> <option value=''> - select type of business -</option> <?php $sql = "SELECT tbl_typesofbusiness.id, tbl_typesofbusiness.Agent FROM tbl_typesofbusiness"; $res = mysqli_query($con, $sql) or (mysqli_error($con)); while (list($id, $tob) = mysqli_fetch_row($res)); { echo "<option value='$id'>$tob</option>\n"; } ?> </select> </td> <td><span class="error">* <?php if (isset($errors['typeofbusiness'])) echo $errors['typeofbusiness']; ?></span></td> </tr> i can get rid of the error bie adding 'or die' on line 253 other than just or but what this does is stop everything under or die stops working cause ive got another 6 or 7 fields under type of business aswell as this no error occurs so im confused to hell, hopefully its not to complicated any help will be greatly appreciated
  19. i am creating a timesheet in php , i need a logic to update the database , the working is as follows 1. accept employee_id and date , from date get week number , query database with this input as follows my database task3 contains and id , emp_id , p_name , time , taskdate mysql_query("SELECT p_name, SUM(IF(DAYOFWEEK(taskdate) = 2, `time`, 0)) AS `MO`, SUM(IF(DAYOFWEEK(taskdate) = 3, `time`, 0)) AS `TU`, SUM(IF(DAYOFWEEK(taskdate) = 4, `time`, 0)) AS `WE`, SUM(IF(DAYOFWEEK(taskdate) = 5, `time`, 0)) AS `TH`, SUM(IF(DAYOFWEEK(taskdate) = 6, `time`, 0)) AS `FR`, SUM(IF(DAYOFWEEK(taskdate) = 7, `time`, 0)) AS `SA`, SUM(IF(DAYOFWEEK(taskdate) = 1, `time`, 0)) AS `SU` FROM task3 WHERE e_id = '$r' AND WEEK(`taskdate`,-1) ='$week' GROUP BY p_name "); this is returned through ajax onto my page , and then i can change date and get the result ,(check the attachments) i want to update the textboxes , this is my issue , i need a logic to get left-mist coloumn project_name and top coloumn date . table is created in php , with textboxes and values set to those coming from database ,
  20. im trying to get my trim function to work is this right, im pretty new to this so sorry if its a stupid question. <tr> <td>Name:</td><td> <input type="text" name="name"><?trim($str);?></td> <td><span class="error">* <?php if (isset($errors['name'])) echo $errors['name']; ?></span></td> </tr> and im getting an error like this Undefined variable: str
  21. when click on the add new button table , label , textboxes(html form) , all apear same as above...view in photo
  22. Not sure if this the best forum for this, but here goes: Background: I have an account with Smugmug.com They recently revamped their website. With this revamp, they no longer allow you to add your own Javascript to customize your page. They only allow HTML and CSS modifications. So I created a free website through awardspace that allows me to run JS and PHP scripts. I want to create a way for a client to enter their last name and their password and have their pages opened in new tabs. Question: How do I do this without javascript? I can do it for a single page using PHP, but as far as I can tell PHP cant open multiple tabs... Here's the HTML: <form action="http://myfreescriptingsite.com/ClientSearch.php" method="get"> Name: <input type="text" name="tName"><br> Password: <input type="password" name="tPassword"><br> <input type="submit"> </form> I control the ClientSearch.php file. This could also be an HTML page or a JS file... Here is the ClientSearch.php file: $name = strtolower($_GET["tName"]); $password = $_GET["tPassword"]; switch($name){ case "smitherton": if ($password == "password") {header("Location: http://www.myrealwebsite.com/Clients/Smitherton/SmithertonFamily2013");} break; default: header("Location: http://www.myrealwebsite.com/Client-Search/"); } Again, the above PHP code only works for one location. I need it to load up multiple pages: if ($password == "password") { header("Location: http://www.myrealwebsite.com/Clients/Smitherton/SmithertonFamily2011"); #header("Location: http://www.myrealwebsite.com/Clients/Smitherton/SmithertonFamily2012"); #header("Location: http://www.myrealwebsite.com/Clients/Smitherton/SmithertonFamily2013"); } Any ideas on how to accomplish this? Thanks, Dave
  23. I know the line below adds a table row but what is the significance of "alt"? <tr class="alt">
  24. Hi guys, I am new to php programming and need your assistance in developing a registration system for my site .I have developed the registration form using html5 , css, jquery and javascript. and now need a functional php script which is going to work for my registration form. The Registration form includes 4 step process for successful registration of a user.The fields of the form are as follows: First Step: username password re-type password Second step: first name last name email Third step age gender country Fourth step: Summary(displaying all user information which user has given through out the registratioin process) For user viewing,I have included a progress bar, which shows the percentage of completion of the registration process. I have attached the screenshot below for the registration form. Kindly help me in building a functional php script for the registration form. Thanks
  25. Hello all, new to the forum. I have been struggling with a PHP problem for the past week and have turned to you as a last resort. I have everything set up mostly right, but there are specific features that I need from http://datatables.net/index that I would love to feature on my inventory page. What happens on my page, is that the whole csv contents show. But the rows do not hide as in the examples you can see on the datatables website. The search bar also does not appear. These are standard features nestled within the datatables.js code. So I am guess they disappear because of the way the PHP is set up to view the rows. These features are really important for the future functionality of my site as well! I have the PHP code as follows: <?php set_time_limit(0); function csv_split($line,$delim=',',$removeQuotes=true) { #$line: the csv line to be split #$delim: the delimiter to split by #$removeQuotes: if this is false, the quotation marks won't be removed from the fields $fields = array(); $fldCount = 0; $inQuotes = false; for ($i = 0; $i < strlen($line); $i++) { if (!isset($fields[$fldCount])) $fields[$fldCount] = ""; $tmp = substr($line,$i,strlen($delim)); if ($tmp === $delim && !$inQuotes) { $fldCount++; $i += strlen($delim)-1; } else if ($fields[$fldCount] == "" && $line[$i] == '"' && !$inQuotes) { if (!$removeQuotes) $fields[$fldCount] .= $line[$i]; $inQuotes = true; } else if ($line[$i] == '"') { if ($line[$i+1] == '"') { $i++; $fields[$fldCount] .= $line[$i]; } else { if (!$removeQuotes) $fields[$fldCount] .= $line[$i]; $inQuotes = false; } } else { $fields[$fldCount] .= $line[$i]; } } return $fields; } $html_body = '<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" type="text/css" href="/css/demo_page.css"> <link rel="stylesheet" type="text/css" href="/css/demo_table.css"> <title>CSV Contents</title> <style type="text/css"> <!-- .style5 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; } .style9 {font-size: 12px} .logo h1 {position: absolute; top: 5px; right: 5px; font-size:14px; } .logo img-with-text {float: left; left 5px; font-size:14px; .img-with-text {text-align: justify; width: 40%; height: 20%;} .img-with-text img {display: block; margin: 0 auto;} .search {margin : 0px;} --> </style> <script class="jsbin" src="http://datatables.net/download/build/jquery.dataTables.nightly.js"></script> <script type="text/javascript" language="javascript" src="/js/jquery.js"></script> <div class="img-with-text"> <img src="/image002.png" alt="sometext" /> <p>WC" is West Coast warehouse- please add approximately 2-3 weeks for the arrival to East Coast.<br><br> </p> </div> <div class="logo"> <br>Last Updated on '.date("F j, Y, g:i a",time()+3600).' </h1> </div> </head> <body id="dt_example"> <div id="container"> <h1> Check Inventory Here</h1> <table> <thead> <tr> <th>Item No</th> <th>Description</th> <th>Price</th> <th>Available</th> <th>Back Ordered</th> <th>On Order</th> <th>ETA WH</th> <th>WC On Hand</th> <th>WC On Ord</th> <th>WC Order Date</th> </tr> </thead> <tbody> '; $fp=fopen("csv/inventory4.html",'w'); $write=fputs($fp,$html_body,strlen($html_body)); $i=0; $content = file("webinvt.txt"); foreach($content as $line) { $l=csv_split($line); if(!strstr($l[11],"SET")) { if($i==10) { $tmp = '<tr>'; $write=fputs($fp,$tmp,strlen($tmp)); $i=0; } $onhand = (int)$l[15]; $committed = (int)$l[16]; $avail = $onhand - $committed; $wcdate = substr($l[23],4); $eastdate = substr($l[19],4); if(strstr($l[1],"DISC")) { $html_body ='<tr "> <td>'.$l[0].'</td> <td>'.$l[1].'</td> <td>'.$l[12].'</td> <td>'.$avail.'</td> <td>'.$l[17].'</td> <td>'.$l[18].'</td> <td>'.$eastdate.'</td> <td>'.$l[21].'</td> <td>'.$l[22].'</td> <td>'.$wcdate.'</td> </tr>'; } else { $html_body ='<tr> <td>'.$l[0].'</td> <td>'.$l[1].'</td> <td>'.$l[12].'</td> <td>'.$avail.'</td> <td>'.$l[17].'</td> <td>'.$l[18].'</td> <td>'.$eastdate.'</td> <td>'.$l[21].'</td> <td>'.$l[22].'</td> <td>'.$wcdate.'</td> </tr> '; } $write=fputs($fp,$html_body,strlen($html_body)); $i++; } } $html_body=' </tbody> <tfoot> <tr> <th>Item No</th> <th>Description</th> <th>Price</th> <th>Available</th> <th>Back Ordered</th> <th>On Order</th> <th>ETA WH</th> <th>WC On Hand</th> <th>WC On Ord</th> <th>WC Order Date</th> </tr> </tfoot> </table> </body> </html>'; $write=fputs($fp,$html_body,strlen($html_body)); fclose($fp); ?> Furthermore, I have to include this piece of javascript inside the HTML variable.: $(document).ready(function() { $('#example').dataTable(); } ); Any help will be greatly appreciated!
×
×
  • 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.