
lioslios
Members-
Posts
24 -
Joined
-
Last visited
Everything posted by lioslios
-
hello guys i have 2 time variables $time1 = 22:00; $time2 = 03:00; my $current_time is 01:00 how can i figure that $current_time is betwean the $time1 and $time2 the if ($current_time > $time1 && $current_time < $time2) works if the day not change! is any way to ignore the day change thanks
-
josh problem now i check better in the funcion i wand to know the part time i am by the current time of server the $day_starts_to_count_from is just an offset type (and set that the day dont change at the 00:00 night but 07:00 at morning! so the first of the 4 parts is 07:00-12:00 ) and if the server time is 11:00 then im at the first part!!!!! thanks
-
joshthank you verry much, its beter the fumction to return me the start and end time of the part also!, so if you can chenge, il be greatfull Psychoyou have write with daylight savings but i dont think is problem, but when i finish the entire script i emulate this to see how it goes
-
hello guys i wand to split the 24h of a day to parts and select the time that i wand to start the 24h circle to count! lets say i give 2 int variables $day_starts_to_count_from=00; $split_day_to_parts=4; so! $hours_per_part = 24/$split_day_to_parts; this gives me $hours_per_part = 6 (i split the 24h every 6hr) how to know the part of my current hour? lets say the system time is 15:35 how to find that im at the 3d part 12:00-18:00 if the 24h circle starts to count from 00:00 thanks in advance
-
yes uses sessions but i kill the session only with logout button
-
i hafe an ordering application, so the client pc some times stay long time on the page without do nothing! so after some time, if i make a selection h get some errors on the page, and i must logout and login agen! is any time out configuration on php or apache (i dont use cookies in my code so no time out for cookies) thanks
-
my english is no so good sorry can i use this?? COUNT(productname*quantity) sample tabe quantity*******productname 1 car 1 car 2 boat 1 boat 1 car so to get the resault boat = 3 car = 3 as it is this time i get boat = 2 car = 3 thanks
-
ok this works fine! one more question, i get the similar products eg cars says 20 but in the records i have and the quantity field that says 5 cars for a record so the count must be productname * quantity for each record! the result is xorrect only if quantity is 1 $result = mysql_query("SELECT id,productname,price,quantity,finalprice,seller,datetime, COUNT(productname)AS num FROM orderhistory GROUP BY productname ORDER BY num DESC"); while ($row = mysql_fetch_assoc($result)) { echo "<tr>"; foreach($row as $cell) echo "<td ALIGN=\"center\">$cell<FONT></td>"; echo "</tr>\n"; } thanks
-
guys i have 2 tables one is the product table and holds the id,productname,price and second tables is the daysales and holds the slles of the day in the fiels id,productname,price,seller,datetime... my script works as: if a saler sells somthing then the sale stores to the daysales table! and in the end of day i use a button to diplay the intire table on the webpage and this works too!!! if(isset($_POST['sub11'])) { if ($_SESSION['read_data']==1) { $result = mysql_query("SELECT * FROM $serv"); while ($row = mysql_fetch_assoc($result)) { echo "<tr>"; foreach($row as $cell) echo "<td ALIGN=\"center\">$cell<FONT></td>"; echo "</tr>\n"; } } } BUT I WAND TO ADD a second table that displays the "same products" e.g. if the product car sells more than one time then i wand to get the car is 3 times selled!!! the boat 6 times ... ... ... any idea for this? thanks
-
hello with tis button i generate some statistics from mysql if(isset($_POST['sub1'])) { $result = mysql_query("SELECT servitoros1, COUNT(*) from history WHERE serv LIKE '%be%' group by serv1"); while($row = mysql_fetch_row($result)) { echo "<tr>"; foreach($row as $cell) echo "<td ALIGN=\"center\">$cell<FONT></td>"; echo "</tr>\n"; } mysql_free_result($result); } but each record have datetime field!! so how can i set this display betwean 2 selectable datetimes e.g. from 2/2/2011 15:45 to 3/2/2011 23:59
-
guys i have this dropdown menu echo "<form method=\"post\" action=\"\">"; echo "<center><select name=\"mydropdown\" size=\"0\" style=\"height:4em; width:15em;\">"; echo "<option value=\"Milk1\">{$_SESSION['tem1']}</option>"; echo "<option value=\"Milk2\">{$_SESSION['tem2']}</option>"; echo "<option value=\"Milk3\">{$_SESSION['tem3']}</option>"; echo "</select></center>"; echo "</form>"; and i wand to update a variable every time i select one of the contents... how can i done this???
-
guys i wand to execute a program on my seerver, i use the $_SESSION['tmp'] = exec("print.exe", $results); and works but when i change the directory $_SESSION['tmp'] = exec("d:\\print\\user1\\print.exe", $results); dont work, works only in root directory, is any way to set the execution to other directorys?? thanks
-
sorry AyKay47 my mistake the ORDER BY "lastname" in the SELECT solve my problem im beginer with this.. thanks thanks verry much
-
Hello guys, im wonder if ca i syntax the insert so i can insert some fields with alphabeticly shorting by name field Thanks
-
the only java script i use is this allert if($_SESSION['non_empty']==0) { echo "<script type='text/javascript'>alert('Παραλαλώ επιλέξτε πρώτα ένα είδος και μετά πατήστε οκ');</script>"; } forgot to mention and sorry for this, that the browser of android pad lags not the pc browsers but this android browser i testet dont lag in any other site! do you know any editor that can check my code for missing closing tags or some edit bugs thanks
-
guys for some reson my browser lags on my page, but not in the start of use, but after i use the page for while, in every php file i use the <?php ob_start(); ......... ob_flush(); ob_end_clean(); ?> also in some submit buttons i have the header("location:someotherfile.php"); exit(); to call other pages is any other command that cleans the buffers or memory.. i think somthing like this is my problem im beginer with php any idea??
-
ye si have try this <form method="post" action="mypage.php#jump"> and works but i have one form tag for 12 byttons so i need more then one jump places, i have start to use one form tag for each button now!, if you have some other idea tellme, thanks anyway!
-
thanks i have make this if(isset($_POST['sub_diplo'])) { $_SESSION['tmp']=$_SESSION['tmp']." counts "; echo "<a name=\"jump\"></a>"; } and near button i have place the <A NAME="jump"> this works but is a correct way to do this?
-
guys i have a submit button that if(isset($_POST['sub_diplo'])) { $_SESSION['tmp']=$_SESSION['tmp']." counts "; } but tthe button is at the end of the page so when i press the button the page reloads and gose to start! exept that my code working! so is any way to move page to first location?? thanks
-
hello guys, i have a question, in some php files i have in the start <? ob_start(); ?> <?php session_start(); ........ ..... ...... if(isset($_POST['sub_1'])) { $_SESSION['address_tmp']=$_SESSION['address_tmp']." oK "; header("location:some_other_page.php#jumpselection"); } if(isset($_POST['sub_2'])) { $_SESSION['address2_tmp']=$_SESSION['address2_tmp']." hello "; header("location:thispage.php#jumpselection"); } ?> <body> <form method="post" action=""> <input type="Submit" name="sub_1" value="action1"style="height:3.9em; width:16.5em; font-size:95%;"> </form> </body> <body> <form method="post" action=""> <input type="Submit" name="sub_2" value="action2"style="height:3.9em; width:16.5em; font-size:95%;"> </form> </body> <? ob_end_flush(); ?> but every page have 10-15 buttons every button in the end reloads the same page with header("location:thispage.php#jumpselection"); or cals another page with header("location:some_other_page.php#jumpselection"); this works but i notise some lag on the bowser afrer while..
-
guys in this code i get some data from myswl table and i display them in to and html table with dynamic textboxes the first part works ok but how can i update the mysqltable with tha changes? i have try to work with one table and i get an error Notice: Undefined index: name1 in D:\....... <?php session_start(); include($_SERVER['DOCUMENT_ROOT'].'/includes/connection.php'); $result = mysql_query( "SELECT * FROM serv " ); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "<tr>"; echo "<td ALIGN=\"center\"><form method='POST'><input name=\"name1\" type=\"text\" value={$row['onoma-eponymo']} id=\"n1\" STYLE=\" border-color:black; border-style:none; border-width:1px; font-size:30pt; color:yellow; background-color:gray; \" size=\"25\" maxlength=\"24\" /></form></td>"; echo "<td ALIGN=\"center\"><form method='POST'><input name=\"name2\" type=\"text\" value={$row['username']} STYLE=\" border-color:black; border-style:none; border-width:1px; font-size:30pt; color:yellow; background-color:gray; \" size=\"7\" maxlength=\"5\" /></form></td>"; echo "<td ALIGN=\"center\"><form method='POST'><input name=\"name3\" type=\"text\" value={$row['password']} STYLE=\" border-color:black; border-style:none; border-width:1px; font-size:30pt; color:yellow; background-color:gray; \" size=\"7\" maxlength=\"5\" /></form></td>"; echo "<td ALIGN=\"center\"><form method='POST'><input name=\"name4\" type=\"text\" value={$row['serv_id']} STYLE=\" border-color:black; border-style:none; border-width:1px; font-size:30pt; color:yellow; background-color:gray; \" size=\"9\" maxlength=\"15\" /></form></td>"; echo "</tr>\n"; } echo "</table>"; if(isset($_POST['back'])) {header("location:admin.php");} if(isset($_POST['sub_update'])) { $text = $_POST["name1"]; mysql_query("INSERT INTO serv (password) VALUES ('$text') "); } ?> <body> <form method="post" action=""> <input type="Submit" name="sub_update" value="Ενημέρωση Αλλαγών"style="height:6em; width:16em; font-size:150%;"> <form method="post" action=""> <input type="Submit" name="back" value="Back"style="height:6em; width:16em; font-size:150%;"> </form>
-
yes AyKay47 you write about drop down but this web application i wand to acsses from my android acer iconia a500 so i beleve the submint buttons ar more easy with the touch screen, if you have in mind some other control exept buttons but touch screen frienly please tellme!!! in the beginig of the post i have ask about mysql_select_db($db)or die(mysql_error()); i say this because when i reload the page some times the browser closes-crashes but this happens only in iconia , in my desktop dont have this problem, so im thinking for data loss from wireless or iconia browser bug, if you have any idea for this please help me many many thanks
-
hello guys im beginer with php sory for my simple and first step questions i have create a page that reads some data from an sql table and displays them, this works but i have some questions 1st the mysql_select_db($db)or die(mysql_error()); means if some error ocoure the connection will close or the entire web pages closes?? 2st is some way to create for each record a dynamic submit button with button text the name of the record? eg id name 1 george 2 nick 3 liana so to create 3 submit buttons with names george nick liana and when i press any button to make an acion thanks