Jump to content

Max45

New Members
  • Posts

    9
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Max45's Achievements

Member

Member (2/5)

0

Reputation

  1. Thaaaaaaaaaaaaaaaaaaaankyou , You really save my time for this advice. It worked Thanks
  2. You mean like this? th, td { text-align: left display: flexbox; flex-order: 1; } th, td { text-align: left display: flexbox; flex-order: 1; }
  3. The following code is showing my result horizontally and I want to show them vertically $id = $_GET['id']; $sql = "SELECT * FROM users WHERE id = $id"; $result = $conn->query($sql); if ($result->num_rows > 0) { echo "<table align=\"center\">; <tr> <th>ID</th> <th>First Name</th> <th>Last Name</th> <th>Email</th> <th>Join Date</th> </tr>"; // output data of each row while($row = $result->fetch_assoc()) { echo "<tr> <td>".$row["id"]."</td> <td>".$row["fname"]."</td> <td>".$row["lname"]."</td> <td>".$row["email"]."</td> <td>".$row["reg_date"]."</td> </tr>"; } echo "</table>"; } Any idea? Thanks in advance
  4. Thanks a lot buddy. And sorry if my post is not understandable. See ya
  5. How to user insert... select... with my two tables based on id? Hi all, I have two tables Table1_Name= users ->Which has all users Tabel2_Name=addfriend -> which I to want add users to it from table1(users) based on their id Here my code that didn't work $id = $_GET['id']; $sql = "INSERT INTO addfriend(fname) SELECT fname, FROM users WHERE id = $id";
  6. I am Trying to put my php echo into bootstrap div like this $result = $conn->query($sql); <div class="alert-success"> echo " <tr> <th>New Users</th> </tr> "; echo "<br />" </div>;
  7. I am trying to add a bootstrap class to php echo in mysql query but it doesn't work Here the code that I using $result = $conn->query($sql); echo ""; echo " New Users "; echo " "; echo ""; Any ides ?
  8. Hi I have made this simple login page by setcookies function and I want now to make a logout button. Here the code <?php /* PHP Form Login Remember Functionality with Cookies */ if(!empty($_POST["remember"])) { setcookie ("username",$_POST["username"],time()+ 3600); setcookie ("password",$_POST["password"],time()+ 3600); setcookie ("color",$_POST["color"],time()+ 3600); //3600 = 1 hour //86400 = 1 day //(8640*30) = 1 month echo "Cookies Set Successfuly"; } else { setcookie("username",""); setcookie("password",""); setcookie("color",""); echo "Cookies Not Set"; } ?> <form action="Cookies.php" method="post" style="border: 2px dotted blue; text-align:center; width: 400px;"> <p>Welcome <?php echo ( !empty($_POST ['username']) ) ? $_POST ['username'] : 'USER'; ?> </p> <p>Username: <input name="username" type="text" value="<?php if(isset($_COOKIE["username"])) { echo $_COOKIE["username"],( !empty($_POST ['username']) ) ? $_POST ['username'] : '';} ?>" > </p> <p>Password: <input name="password" type="password" value=" <?php if(isset($_COOKIE["password"])) { echo $_COOKIE["password"]; } ?>" > </p> <p>Choose Your Favorite Color: <input name="color" type="color" value="<?php if(isset($_COOKIE["color"])) { echo $_COOKIE["color"]; } ?>"> </p> <p><input type="checkbox" name="remember" /> Remember me</p> <p><input type="submit" value="Login"></p> </form> Any idea ??
  9. I have created a simple mysql database with php code and I put it on server using on server phpmyadmin . I added an insert button and everything was ok.But then the code stop working without no reason. Here the URL of my database site: mathcalc.appleschat.com Here the insertion code <?php include "connectToDB.php"; function mksafe($data){ $data=trim($data); $data=strip_tags($data); $data=htmlspecialchars($data); $data=addslashes( $data); return $data } $value1 = mksafe($_POST['fname']); $value2 = mksafe($_POST['lname']); $value3 = mksafe($_POST['email']); $date = date('Y-m-d'); $sql = "INSERT INTO users (firstname, lastname, email,reg_date) values( '$value1', '$value2', '$value3','$date')"; if ($conn->query($sql) === TRUE) { header("Refresh:0; url=index.php"); } else { echo "Error: " . $sql . "<br>" . $conn->error; } $conn->close(); ?> Thanks in advance any help will be appreciated.
×
×
  • 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.