Jump to content

budimir

Members
  • Posts

    522
  • Joined

  • Last visited

Everything posted by budimir

  1. Can you post some code? I'm not too good with javascript!
  2. I could go for any other approach if you have ideas!
  3. OK, that is quite simple. You can use PHP mail() function to send emails. $to = "[email protected]"; //Here goes $_POST["email"]; $subject = "Test mail"; //Here goes some subject like "This is enqur. from web page" $message = "Hello! This is a simple email message."; //Here goes like phone number etc. $from = "[email protected]"; $headers = "From: $from"; //Here goes you're email adress mail($to,$subject,$message,$headers); echo "Mail Sent."; Also, DarkWater is right, go get new book. This is just causing problems for you.
  4. Well, you've got your opinion. And, you are getting OFF TOPIC! We can open a discussion about this somewhere else!
  5. Well, now he will have much clearer picture of how to store data in a DB. I don't see any point in just displaying the values on the form. If he is learning then I showed him much bigger picture and made the situation more understandable for him. And, I'm sorry guys, but if he is learning PHP, then it's much better that he learns how to create a database and establish a link to it, first. Then he can start learning PHP. It's like a building a house from the roof.
  6. You are not trying to get the values from form. $1 = $_POST["name"]; $2 = $_POST["email"]; $3 = $_POST["company"]; $4 = $_POST["number"]; and then query to insert into DB $sql = "INSERT INTO table_name (name_of_fields) VALUES ($variables)"; $result = mysql_query($sql) or die (mysql_error()); That's basiclly all the code you need to insert data in DB. just adjust it according to your needs and to match your DB fields. P.S. You know that you need a connection to DB??
  7. OK, I'm trying to rework this a little bit and I need your help. My knowledge of javascript is not to good. This is what I have for now: <SCRIPT LANGUAGE="JavaScript"> <!-- // by Nannette Thacker // http://www.shiningstar.net // This script checks and unchecks boxes on a form // Checks and unchecks unlimited number in the group... // Pass the Checkbox group name... // call buttons as so: // <input type=button name="CheckAll" value="Check All" //onClick="checkAll(document.myform.list)"> // <input type=button name="UnCheckAll" value="Uncheck All" //onClick="uncheckAll(document.myform.list)"> // --> <!-- Begin function checkAll(field) { for (i = 0; i < field.length; i++) field[i].selected = true ; ------ I have changed this from "checked" to "selected" } function uncheckAll(field) { for (i = 0; i < field.length; i++) field[i].selected = false ; } // End --> </script> And for the event I have done this: onChange="checkAll(document.autoSumForm.list) Couple of questions: 1. Is this possible? 2. document.autoSumForm.list -> list is a name of object on a form, is it possible to use ID instead of name????
  8. Hey guys, Do you know of anyscript where user could choose a value in select box and then automaticlly 3 or more other select boxes would get the same value? For instance: User chooses in selectbox 1 value car And the automaticly selectbox2 gets value car And the automaticly selectbox3 gets value car And the automaticly selectbox4 gets value car And the automaticly selectbox5 gets value car And the automaticly selectbox6 gets value car Or you can point what to search on google!
  9. You are not giving enough info. From the code you've posted we can't see anything. Have you done anything in this matter. If not, post your DB structure so we could see the names of your date fields and explain which field is what.
  10. You are getting output in your db.info.inc file and then header is failing and reporting an error message.
  11. Here is a suggestion. It would be nice to put a small icon next to the topic title for "Topic solved" on the forum index. It would be more visible and easier to access for a user that posted a topic to click that icon and mark topic as solved. Right now, there is a lot users that don't click "Topic solved" and I think this could reduce number of those users. Cheers.
  12. Here is a suggestion. It would be nice to put a small icon next to the topic title for "Topic solved" on the forum index. It would be more visible and easier to access for a user that posted a topic to click that icon and mark topic as solved. Right now, there is a lot users that don't click "Topic solved" and I think this could reduce number of those users. Cheers.
  13. That's what I thought. I thought that maybe there is a way. Thanks a lot for your help.
  14. Here it is: ID From To Distance 1 Zagreb Karlovac 52Km 2 Zagreb Knin 274Km 3 Zagreb Virovitica 154Km 4 Zagreb Split 374Km 5 Karlovac Pula 234Km These are values from DB. I'm not sure how to calculate distance (for example) from Karlovac to Knin??? And other combinations??
  15. OK, maybe you can do this: $query = mysql_query("SELECT email FROM users WHERE email = '".$email."'"); while($row=mysql_fetch_array($query)){ $email1 = $row["email"]; } if ($email1 == $email){ if(@mysql_query($query)) $erroremail = true; $query2 = "INSERT INTO users SET username='$username', password='$password', email='$email'"; } else { echo "Data is already in DB!"; } [/code] Here is antoher check, where we will check if that email is already stored in DB and if it is it will display an error message. Maybe you will need to adjust a code a litlle bit.
  16. Seems to me you will need to use javascript or AJAX for thing you are asking for. There are plenty of simple scripts on Google. Try Google for: "javascript form validation" Cheers
  17. Hey guys, I'm creating a script where I should display distances between two cities. User can choose From - To cities and then distance is displayed For example: City 1 -> City2 = 56km City55 -> City72 = 110km ... In my DB I have this fields: ID date from_city to_city distance How do I calculate which is distance from one city to another???
  18. @iversonm: $a != $b Not equal TRUE if $a is not equal to $b. $a !== $b Not identical TRUE if $a is not equal to $b, or they are not of the same type. (introduced in PHP 4) In both cases he will get the same result in his if function, because it's the same type. Although, as looking now if $_SESSION['token'] = uniqid(md5(microtime()), true); is encoded with md5. Then if ($_GET['token'] != $_SESSION['token']) is always FALSE unless decoded. @lanmind: Where do you get $_SESSION['token'] for your if statment if ($_GET['token'] != $_SESSION['token']) ?
  19. Try this: <?php session_start(); $_SESSION['token'] = uniqid(md5(microtime()), true); if ($_GET['token'] != $_SESSION['token']) { die('Invalid token'); } $coin = $_SESSION['token'];
  20. Thanks a lot guys! I'm waiting for CSS3, until then I will print in Portrait with some adjustments. Cheers.
  21. You already did it, but in a wrong order! Here is a fix: <?php include 'db.php'; include 'function.php'; if($_POST['register']) { //init error variables $errorusername = false; $erroremail = false; $erroremailconf = false; $errorpassword = false; $errorpassconf = false; $username = isset($_POST['username']) ? trim($_POST['username']) : ''; $email = isset($_POST['email']) ? trim($_POST['email']) : ''; $emailconf = isset($_POST['emailconf']) ? trim($_POST['emailconf']) : ''; $password = isset($_POST['password']) ? trim($_POST['password']) : ''; $passconf = isset($_POST['passconf']) ? trim($_POST['passconf']) : ''; if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) $erroremail = true; if(strlen($username) == '0') $errorusername = true; if(strlen($emailconf) == '0') $erroremailconf = true; if(strlen($password) == '0') $errorpassword = true; if(strlen($passconf) =='0') $errorpassconf = true; //display form again if($errorusername || $erroremail || $erroremailconf || $errorpassword || $errorpassconf) { showForm($errorusername,$erroremail,$erroremailconf,$errorpassword,$errorpassconf); } else { //check user email $query = mysql_query("SELECT email FROM users WHERE email = '".$email."'"); if(@mysql_query($query)) $erroremail = true; $query2 = "INSERT INTO users SET username='$username', password='$password', email='$email'"; if(@mysql_query($query2)) { echo 'Signup Completed'; }else{ echo 'failed to signup'; } } } else { echo "Nothing happens!"; //Leave this empty, I just putted it for test } ?>
  22. No, nothing is happening! I don't see why. Should I use: <div class="page"> And put everything inside that div element??? No, div element didn't help!!
  23. Hey guys, I can't work it out, so my page gets printed in landscape. I'm using this peace of code: @page { size: landscape; } Web browser is Firefox 3. I can't see what is wrong!!! Help!
  24. $ranking = mysql_query("SELECT * FROM `" . DBPREFIX . "users` SUM(capture) as capture WHERE ClanID != '0' GROUP BY `ClanID` ORDER BY Capture DESC Limit $limit") or die(mysql_error());
  25. And your problem is...??
×
×
  • 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.