-
Posts
131 -
Joined
-
Last visited
Never
Everything posted by Miko
-
Hi, that didn't work
-
Hello, I have here this query: SELECT COUNT(date) AS aantal FROM DATA WHERE depot = '$pk' AND nr BETWEEN '$pkNV' AND '$pkNB' GROUP BY date DESC LIMIT 10 I can here then echo the "aantal" so I get the amount of results. But I would like to echo the field date also, how can I do that? Thanks
-
not exactly, I have another form where enter AND submit button works :-\
-
Hello, I have a form with 2 radio buttons. Depending of the selected radio button my php script goes to a different site. The script isn't a problem, this one works how it should be. But when enter a value and hit enter the page refreshes and when I click on Track!, it actually goes to the website. ??? my code: <div class="track"> <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" class="track_form" target="_blank"> <input type="radio" name="radio1" value="Parcelnumber" checked><label for="parcel">Parcelnumber</label> <input type="radio" name="radio1" value="Referencenumber"><label for="reference">Referencenumber</label> <br /> <input type="text" name="searchvalue" class="track_search" size="29"> <input type="submit" name="track" value="Track!" class="track_bttn"> </form> </div><!-- track --> <?php $track_bttn = $_POST['track']; $radio1 = $_POST['radio1']; $searchvalue = $_POST['searchvalue']; $username = "******"; $password = "******"; $lang = "en"; if(isset($track_bttn) && isset($radio1)){ if($radio1 == 'Parcelnumber'){ header("Location:xxxxxxxxxxxxxxxxxxxxxxxxxxxx"); } if($radio1 == 'Referencenumber'){ header("Location:*************************"); } } ?> Anyone an idea?
-
yep, that works allso. This code is new to me, what is the exact functionality of this one?
-
go it, I've changed the "action" into action="other.php" and put there the php code. Thanks!
-
You should put your session_start() at the very top of each page.
-
I've tried this one, but I got this as error :-\ Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\Test\google.php:1) in D:\xampp\htdocs\Test\google.php on line 11 my code: <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" target="_blank"> Go Google: <input type="text" name="bla"><input type="submit" name="go" value="GO"> </form> <?php $go = $_POST['go']; if(isset($go)){ header('Location:http://www.hotmail.com'); } ?>
-
thanks this is not realy the problem, I forgot the mention the real question (d'oh). in the if(isset($track){ // how can I code here that he must go to website a? }else{ // same thing here? }
-
Hello, I have a search form where a user can insert 2 different values: - track - reference depending with what kind of value the user want's to search this one is send to another website/link - track -> for ex: www.track.com - reference -> for ex: www.reference.com The form has 2 radio buttons, so the user must chose one of both to get his result. The action is not a problem, but it's how to know if the user has chosen track or reference. I know that it should work with a if($track){go website}else{go other website} But I don't know the whole technical part of this, anyone can help me out here? Thanks
-
Correct, I changed the , into . Thanks
-
Hello, I have some values in a column, these values are prices/amounts, something like this: 1400,63. Now I would like to make the SUM from some values, so my query should be like: SELECT SUM(AMOUNT)FROM table So assuming that I have 1400,63 and 1200,31 in my table, than the SUM result should be: 2631,63 But what I get is 2631 without the 2 numbers after the comma. This is very important since the data in the database is real data from invoices etc ... . Maybe a setting of my column? Anyone?
-
hi, thanks for the respons, but it doesn't work ???
-
Hello, I'm trying to make a query that select's the max date: my query is like this: SELECT MAX(scandate) AS datum FROM STATUSDATA WHERE depot = '$pkdepot' AND pknr BETWEEN '$pknv' AND '$pknb' this query isn't a problem, but I would like to echo the column depot also. I know that I can do that with another query, but I want that it is done with 1 query. Thanks
-
Hello, I've made a little script that calculates a percentage. The script works good and he calculates correctly, but some results are with several numbers after the , . I want to show only the 2 numbers after the , . Anyone knows how to do that? Thanks
-
Hello, Thought that my other post about login script was enough but it wasn't I've got the concept about how to create a login with checking if your data submited is correct. But now I'm encoutering a problem with the sessions. My scripts echo's a message when your logged in after submited the form, no problem here. But I must include this script in every other page because some of the options on the other pages may be viewed by A, B and not by C for exemple. Now the script is included in my page, but it seems that I must relog every time I change the page. Strange thing is after submited the form for login I get the message that login is succesfull and when I click again on my home page (where the login form is) I get again the login form. So it seems I'm forgetting something here. My complete code: authentication.php: <?php require "config.php"; if(isset($_POST['submit'])){ $username = mysql_real_escape_string($_POST['username']); $password = mysql_real_escape_string($_POST['password']); $password = md5($password); $query = "SELECT * FROM USERS WHERE USER = '$username' AND PASSWORD = '$password'"; $result = mysql_query($query); if(!$query){ echo "Query failed."; } else{ $_SESSION['username'] = $username; $_SESSION['sid'] = session_id(); $_SESSION['ip'] = $_SERVER['REMOTE_ADDR']; echo "Succes! You are now logged in!"; } } ?> login form: <div id="login"> <form action="authentication.php" method="post"> <table> <tr> <td>Username:</td> <td><input type="text" name="username" class="input"></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="password" class="input"></td> </tr> <tr> <td><input type="submit" name="submit" Value="Login!" class="button"></td> </tr> </table> </form> </div><!-- login --> Anyone an idea what I'm forgetting? thanks
-
I need some sleep ... the table calls Nummer .. not Number .. Changed the name and it's working. D'oh! Thanks anywayz
-
Dit that and got this: SELECT * FROM Number WHERE depot LIKE '0530' AND '7000732032' BETWEEN from AND to
-
hmmm, did not work either :-X. I'm thinking that I'm making a mistake with 'AND' that is between my 2 variables. Could be?
-
the 'from' and 'to' are the names of the columns
-
Hello, I'm making a script where a user can insert a value of 14 numbers to search a corresponding ID. This value should be broken down in 2 (first 4 numbers and then 10 numbers). I've done this with a substr so here no problem. But now I have to query this value with a BETWEEN. my code/query $parcel_depot = substr($searchterm, 0, 4); $parcel_number = substr($searchterm, 4, 10); $parcel_sql = "SELECT * FROM Number WHERE depot = '$parcel_depot' AND '$parcel_number' BETWEEN 'from' AND 'to'"; But seems that it doesn't work. What am I doing wrong here? Thanks :-)
-
Hello, I've made a php script that get's data from my mysql database and shows it in a box. This box has a fixed height and width, so the data that retrieved from the database is displayed per result with paging. So my query is based on a limit = 1 so only 1 result is returned and when clicking on a link from the paging he will fetch the following record to display this one. I don't know if Coda Slider could work like this? I get 1 result, have links to fetch the other records and when clicking on those links the effect should work. Anyone knows this? Thanks
-
thanks, it worked
-
Hello, I was wondering if the following is possible: one of my scripts get's data from the mysql database and in one of the collumns has email addresses. Now that collumn can contain several addresses al seperated with an ";" . It should stay with the ";" in the database but must be show in html with an non breaking space ( ). I was just trying to "fix" this with an array like this: $dot_comma = array(";" => " "); but then he doesn't show anything. Someone has an idea? Thanks