Jump to content

tbobker

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tbobker's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. UPDATE: Typical, as soon as a posted this message I solved it. For some reason php doesnt like my on=1. I changed this to status=on and all is good. I have a ini file called settings.ini it contains the following: [system] on=1 The idea is that I update this ini file to turn the application on or off, 1 being on. When I use parse_ini_file("settings.ini") I receive this error The PHP calling this is: $ini = parse_ini_file("settings.ini"); What is wrong with this and is using a ini file the way to go. I thought its a bit much having it in a database its just a flag to tell the application if the system can run or not. Any help appreciated. I just cant see what the issue is.
  2. So I am building a contextual solution and need to consider using the following processes of machine learning and natural language processing. While I suspect that this kind of text parsing / analysis is usually done using programming languages like C++ are there any libraries or platforms that can help me achieve the same using PHP? I was thinking probably I would need to create some PHP modules from C++ and call them in my PHP code? Any guidence, help or advice appreciated.
  3. I have a text file and want to search the file for a particular word, and whenever it appears put it in bold? All i seen to come up with is regular expressions and i have no idea how to use them.
  4. Ok thanks for the feed back, yes that does seem like a good way, however how can i get the date field to work?
  5. Hi i have got a mysql database that is storing information for an online petition. One of the fields is a date field, but it is not recording the date. When i display all the fields to see who has signed the petition, the date field displays 0000-00-00.  How can i activate the date field so it reads the actual date of insert?
  6. Thanks that has helped and will this stop any sql injection attempts by escaping with the \?
  7. [code] <?php if(isset($_POST['submit'])) { $first = $_POST['fname']; $last = $_POST['lname']; $address = $_POST['address']; $email = $_POST['email']; $pcode = $_POST['pcode']; $country = $_POST['country']; $comment = $_POST['comment']; $conn = mysql_connect("localhost","",""); mysql_select_db("",$conn); $sql = "insert into petition values ('','','$first','$last','$address','$email','$pcode','$country','$comment');"; $result = mysql_query($sql,$conn); $sql2 = "select id from petition"; $result2 = mysql_query($sql2,$conn); $num_rows = mysql_num_rows($result2); echo "<div height='300px'><h1>Thankyou for signing the petition</h1><br>".$first."&nbsp;".$last." you have made a positive step forward</div>"; echo "<br><h2>You are person&nbsp;<span style='color: red'>".$num_rows."</span>"; }else { echo ' [/code] i need to mysql_escape_string() the values but i dont know how to do it with multiple values?
  8. on my login script i want it to display a message only if they have got the username and password wrong more than once. I have tried various while loops and so on but cant get it to only display one time because of the loop it keeps displaying the message again and again.
  9. What is wrong with this? Here is my login part: [code]<html> <body> <div align="center"> <form method="post" action="login.php"> Username:&nbsp;<input type="text" name="username"><br> Password:&nbsp;<input type="text" name="password"><br> <input type="submit"> </form> </div> </body> </html>[/code] and here is the login script: [code]<?php include("dbconnect.inc"); $sql = "select * from login"; $result = mysql_query($sql, $conn); $row = mysql_fetch_assoc($result); if($_POST[username] && $_POST[password] == $row[username] && $row[password]){ include("index.php"); } else { echo "wrong login <a href='index.html'>Go back</a>"; } ?>[/code] Why isnt it working? there are no errors just wont login.
×
×
  • 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.