331 Posted Topics
Re: This may go over your head a bit but this is how i would do it, just tested it in chrome and works: [CODE=php]<?php $year = "2011"; // update if (isset($_POST['Submit'])) { echo "Year selected is " . $_POST['year']; } if(!ctype_digit($_POST['year'])){ $_POST['year'] = date("Y"); } ?> <html> <form name="form1" method="post" … | |
Re: do you have a mail server setup on your pc(localhost)? you can download something like hmail - [url]http://www.hmailserver.com/[/url] if you dont have a mail server on your pc. OR just setup php.ini to connect to some mail account that you use, hopefully you have some email account around like a … | |
Re: I've done this on different domains, i'll see if i can find what i did.. I set it so the login updated the token in both databases, then on the redirect included the token in a GET var, which soon as you jump across to the new site it resets … | |
Re: Theres no need to put the birds name in the value, always use it's id to reference it [CODE=php]<option value="<?php echo $row['bird_id'];?>"><?php echo $row['name'];?></option>[/CODE] the id is the bird and all its data including the name, no need to store it anywhere else | |
Re: [CODE] header("Location: members.php?id={$id}"); //or header("Location: members.php?id=".$id); [/CODE] header is a php command and is already inside php tags so there is no need to use php tags again, it's like playing with a string such as echo "members.php?id=$myvar"; String help: strings in php are opened with a single or double … | |
Re: He's right i would start spliting it out to be more flexible, thats way too much repeating yourself. as a quick fix you could try changing these lines: [CODE]if(move_uploaded_file($t_name,$dir."/".$finalfile1))[/CODE] to [CODE]@move_uploaded_file($t_name,$dir."/".$finalfile1)[/CODE] for all 8 files, them if's are not enclosed like if(){ } so it is likely skipping the next … | |
Re: Heres how i set cookies [CODE=php]setcookie("token", $token, $expire, "/");[/CODE] The last variable "/" is the path the cookie is available in, which had me confused for awhile when i first got into cookies. If you set a cookie in a directory called setup, [url]http://example.com/setup/[/url] that cookie is only available in … | |
Re: You can't control that on a web page, once its downloaded they got it to print as mmuch as they want | |
Re: [QUOTE=grayson773;1779083]I've looked up many different answers to the question I'm asking but none have them have seemed to work and im completely confused as to why. Here the the problem: When ever I enter the information into the form on the website, I get the message Error: No database Selected. … | |
![]() | Re: line 49 closes a function then attempts to do an else missing the } 48 } 49 }); 50 else{ ![]() |
Re: put this in, my guess is $_SESSION['certificate'] isn't what you expect or even just a string [CODE] var_dump($old); var_dump($_SESSION['certificate']); if ($old < $_SESSION['certificate']) { [/CODE] | |
Re: [CODE] ?> <script type="text/javascript"> <!-- function printDiv(id){ var divToPrint=document.getElementById('content'+id); var newWin=window.open('','Print-Window','width=100,height=100'); newWin.document.open(); newWin.document.write('<html><body onload="window.print()">'+content.innerHTML+'</body></html>'); newWin.document.close(); setTimeout(function(){newWin.close();},10); } //--> </script> <?php if ($record!=0){ $i = 0; while ($row = mysql_fetch_row($result)){ //print_r($result); $pName = $row[2]." ".$row[3]." ".$row[1]; $dName = $row[47]." ".$row[48]." ".$row[46]; $date = $row[14]; $RBS = $row[15]; $glucose = $row[16]; $bun … | |
Re: [CODE=mysql] SELECT id, name, count(*) as `albums` FROM artists LEFT JOIN albums ON artists.id = albums.artistid WHERE artists.name like '$keyword%' GROUP BY artists.id ORDER BY artists.name ASC LIMIT 15; [/CODE] the ajax doesn't look like the complete code either so hard to advise on that, if it's stopping things that … | |
Re: I'd switch to using mysql_fetch_assoc() that sort of thing will do your head in trying to figure it out, not that you have to but i would find it annoying picking up on that code afterwards. [CODE]<?php $username = $_SESSION['username']; $query = "select * from tblpatient_info i, tbllab_bloodchem b, tbldoctor_info … | |
Re: [CODE]$body= .$name. .$number.[/CODE] should be [CODE]$body= $name.$number;[/CODE] | |
Re: whats the source of the page when you view it in a browser? Didnt see anything wrong in that code also [CODE]<?php if(isset($_GET['password'])&&($_GET['password']=="") )[/CODE] [CODE]<?php if(!isset($_GET['password']) || (isset($_GET['password']) && $_GET['password']==""))[/CODE] will work if $_GET['password'] isn't set as well | |
Re: what date ranges? its an array of dates $array = array('01/01/2012','01/02/2012','01/03/2012','01/05/2012','01/10/2012'); foreach($array as $v){ echo $v."<br/>\r\n"; } | |
Re: i think you need to make different var names, you are overwriting and using the same var for completely different things? [CODE=php] function vote($column, $imgid){ //the $column stands for a variable handling a string I've passed from my previous call. For now I am setting it as a string named … | |
Re: [CODE=css]background-color; #000000;[/CODE] facepalm moment | |
Re: how about this sort of approach? [CODE=mysql] DELIMITER $$ CREATE TRIGGER `database`.`trigger1` AFTER INSERT ON `database`.`table` FOR EACH ROW BEGIN #check sum reached and do whatever when it is #UPDATE `table` SET `field` = 'value' END$$ DELIMITER; [/CODE] | |
Re: [CODE=mysql]SELECT consultant,FLOOR(SUM(`numsales`)/10) AS `entries` FROM `salestable` GROUP BY consultant[/CODE] [CODE=php] <?php $Q = 'SELECT consultant,FLOOR(SUM(`numsales`)/10) AS `entries` FROM `salestable` GROUP BY consultant'; $R = mysql_query($Q); $entries = array(); while($row = mysql_fetch_assoc($R)){ if($row['entries'] > 0){ $i = 0; while($i < $row['entries']){ $entries[] = $row['consultant']; $i++; } } } echo "Total Entries: … | |
Re: [QUOTE=kukula;1774597]OK I did it. Now validator announce that everything is ok. What now, because the website is still not working on Firefox and IE.[/QUOTE] Welcome to the pain of web design. | |
Re: left: 50%; needs to be changed to accomodate the width of the menu eg menu = 10% of width, left becomes 55% | |
Re: confusing cause you seem to know how it should be: articles id,title 1,article1 2,article2 3,article3 comments id,artid,comment 1,2,hello 2,2,hi 3,1,nice article 4,3,another comment article.php?id=1 $Q = "select * from comments where artid = $id"; | |
Re: I've only ever seen the rel attribute used on a, link & style tags, never come across it being used in a gallery before. An attribute is just a variable passed along in some code so it won't matter what you attach it to, it just may do nothing cause … | |
Re: the problem is the update sql isnt even ran [CODE=php]{ echo "Your booking has been deleted"; $sql = "UPDATE filmshowings SET maxtickets = maxtickets + $tickets WHERE showingID = $id"; -->mysql_query($sql); }[/CODE] [CODE=php]<?php session_start(); $tickets = ['tickets'];//??? should be $_SESSION['tickets'] ? //$tickets = $_SESSION['tickets']; //$id = $_SESSION['showingID']; $conn = mysql_connect("localhost", … | |
Re: my first and most important goal of coming across anything microsoft is finding how to export it as csv so i can actually do stuff with it - probably just that i never bothered learning any of the microsoft languages though. for that example in php i can think of … | |
Re: Not too sure what you're asking. The best method i can think of to store that data is to store all bookings it all in its own table. id,roomid,start,end 1,1,2012-03-05 07:00:00,2012-03-05 21:00:00 2,1,2012-03-07 07:00:00,2012-03-07 21:00:00 3,2,2012-03-02 07:00:00,2012-03-08 12:00:00 4,3,2012-03-04 07:00:00,2012-03-05 12:00:00 Then on any updates of people staying longer/leaving early … | |
Re: I'd use javascript for that or does it have to be php? | |
Re: Here's the main code for mailing a form i just cut out of a function of mine [CODE=php]<?php if($_POST['submit'] == 'TRUE'){ $postdata = array(); $msg = "<h1>Form Filled in at ".date("Y-m-d H-i-s")."</h1>\r\n"; $msg .= "<table>\r\n"; $msg .= "<tr><td>Field</td><td>Value</td></tr>\r\n"; foreach($_POST as $k=>$v){//delete the space inbetween & #39; and & #34; $v … | |
Re: i would get a program to search through all the sites files looking for a case-insensitive "ppric" . Will likely be a lot you need to look for places that "UPDATE `table` set `ppric` = ''" is being called. It could literally be anywhere, to find it you need to … | |
Re: This is of interest to me as well, we don't need even close to that size(yet) have been wanting to get into a cluster for redundancy and improved speed. We noticed a big lift in performance awhile back, around 50%, from upgrading to SSD drives. We also upgraded to raid … | |
Re: Heres how i would do it, i don't know your mysql table structure enough to pull the time though. Whats `table_time` and `table_relate` and how are they linked to table_period? [CODE=php]<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="1px"> <?php function getTimetable($teacherID,$con = false){ if(is_int($teacherID) || ctype_digit($teacherID)){ $Q = "SELECT week_dayID, period FROM … | |
Re: [CODE]echo "<script type='text/javascript>window.location.href='http://www.example.com/';</script>";[/CODE] | |
Re: When you say databases do you mean 2 tables? [CODE=mysql]DELETE FROM `table2` WHERE `id` IN (SELECT `id` FROM `table1`)[/CODE] [CODE=php] $con = mysqli_connect('1.2.3.4','user','pass','database'); $Q = "DELETE FROM `table2` WHERE `id` IN (SELECT `id` FROM `table1`)"; if(mysqli_query($con,$Q)){ echo 'entries deleted from table2'; }else{ echo 'delete failed: '.mysqli_error($con); } [/CODE] | |
Re: yes [CODE] <?php $array1 = array("iphone", "ipad","iMac"); for($test = 0; $test <= 2; $test++) { echo "<a href='https://www.google.com?{$array1[$test]}'>Click me</a><br />"; } ?>[/CODE] you can also use foreach() [CODE] $array1 = array("iphone", "ipad","iMac"); foreach($array1 as $value){ echo "<a href='https://www.google.com?{$value}'>Click me</a><br />"; } [/CODE] | |
Re: Update line 8 to this and it will tell you if theres an error [CODE=php] $get_produkt_info = mysqli_query($connection, " SELECT produkter.id, produkter.brand_id, produkter.varetype_id, produkter.stock INNER JOIN vare_type ON (produkter.varetype_id = vare_type.id) INNER JOIN sizes on (produkter.id = sizes.produkt_id) WHERE produkter.id = '".$P_ID."'") or die(mysqli_error($connection)); [/CODE] | |
Re: Went through the code bit by bit, edited a few bits but the only thing i saw that would make it not work is the cookies are set for "www.web.com" and the header redirect goes to "web.com" [CODE=php]<?php $SELF=basename(__FILE__); $msg=''; if(isset($_POST['username']) && !empty($_POST['username']) && isset($_POST['password']) && !empty($_POST['password'])){ $link = mysql_connect('', … | |
Hi thought i'd try here see if anyone can help solve this quicker. First off we have a email database. The main table is the email data, all unique rows per email address with a unique id. eg. emailid,email 1,email@example.com 2,email@example.co.uk Next we have another table which logs the data … | |
Re: [QUOTE=webman07;502005]I have bought a legal copy of SQL Server 2000 to put on one of my websites but can't seem to get it to load. Any ideas?[/QUOTE] You need to actually get onto the desktop of you're server that is hosting your website. You need a dedicated server to do … | |
Re: In an external file you can make quite generic then you can attach it to multiple forms such as a process script that expects post data, an email address, from line and redirection page and just checks and emails it using the data. You can then link 10 forms to … | |
Re: you mean like this? target="_top" <iframe src="professor.html" width="100%" height="100%" frameborder="0" scrolling="no" target="_top"/></iframe> I dont get the purpose of url masking, why hide it? it's easy to find it out if you really want to ![]() | |
Re: [QUOTE=nakresimin;1770415]woudl it look like below for only deleting [CODE]<?php $con = mysql_connect("localhost","peter","abc123"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_query("DELETE * FROM table1,table2,table3"); mysql_close($con); ?> [/CODE] and removing then deleting [ICODE]<?php $con = mysql_connect("localhost","peter","abc123"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_query("SELECT * FROM … | |
Re: You want it so the select box remembers what city you have picked? [CODE=javascript] var lastTown = '<?php if(ctype_alnum($_GET['town'])){echo $_GET['town'];}?>'; function showUser(str){ if(str==""){ document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else{// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && … | |
Re: error_reporting(0); -> error_reporting(E_ALL); Oh it's obvious now i think about it, you have to call a header before ANY output - the php needs to start on line 1 with no white space and then you cannot print or echo any data out until the header is called or the … | |
Re: use sqlyog and connect to your database, it has a built in ability to export any table as xml or csv. [url]http://code.google.com/p/sqlyog/[/url] Its free to use, just click downloads | |
Re: the group by needs to be on the unique id for each row you want to pull, eg. If you want to pull a list of users, you want the group by to be on the user id so you get no duplicates and i would keep the id group … | |
Re: Sounds a very complex way of doing a simple thing. You want to select from the auction table as the base table for your query [CODE=mysql]SELECT * FROM `wp_wpa_auctions` AS `auctions`[/CODE] Then Join on the bids table for who has bidded on what [CODE=mysql]LEFT JOIN `wp_wpa_bids` AS `bids` ON `auctions`.`auction_id` … | |
Re: Hows this? [CODE=mysql]GROUP BY child.nid,child.sid HAVING child.rating = MAX(child.rating) ORDER BY MAX(child.rating) DESC[/CODE] It pulls the lot then drops everything thats not the highest child.rating for the group and then orders highest to lowest | |
Re: [CODE=javascript]var d = new Date(); var hours = d.getHours(); var mins = d.getMinutes(); //measure them in minutes since midnight var curMins = (hours*60)+mins; if(curMins >= 495 && curMins <= 600){//495 == 8:15 600 == 10:00 //do counter } if(curMins >= 630 && curMins <= 720){//630 == 10:30 720 == 12:00 … |
The End.