Jump to content

Search the Community

Showing results for tags 'Php'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








  1. I am trying to set a cookie when there is no cookie from my website found on the user's PC, but the following line of code doesn't work inside a function: $cookiename = "test"; $cookievalue = "tests"; setcookie($cookiename, $cookievalue, false, "/", "localhost"); It does work however if it is placed outside of the function. For exampe, the code above works, but the next code doesn't: $cookiename = "test"; $cookievalue = "tests"; function addCookie() { setcookie($cookiename, $cookievalue, false, "/", "localhost"); } addCookie();
  2. I've run into an annoying problem with spacing that I can't seem to code myself out of. I have a table with a 400x100 image at its background in a page that is set max-width=400px, intended to be full width on mobile devices. The containers honor this, but somehow the image is being resized. Note the right edge of the screen, the 400px image is not aligned with the 400px containers. So i borrowed iPhone5 and I found a different problem. the far right of the image is clipped, so I dropped the last label and radio button down to the next container for the first set. That is when
  3. <?php if (empty($count)) { $count=''; } if ($count == '') { $count ='1'; } else { $count++ ; } echo $count; echo '<br>'; ?> My goal is to make a script that increments $count ever time someone downloads the page. Can this be done without 'storing' the $count value? Or should I create a script with fwrite/fopen or $_SESSION?
  4. I notice that some sites on the clear web but most on the dark web show their PGP public key. ​I have a pgp privet key that was auto generated along with my .onion url when I opened the tor browser. I also took a look at https://github.com/singpolyma/openpgp-php and my question is... How do I display a PGP public key on a website that relates to my site url using php?
  5. Hi, I am having an issue with a warning that keeps popping up. I have edited the line it is saying but still getting the error. Warning: Cannot modify header information - headers already sent by (output started at /Pages/Forums/comments.php:227) in /Pages/Forums/comments.php on line 88 Here are the two lines that the warning is saying function setNote($conn) { if (isset($_POST['NoteSubmit'])) { $id = mysqli_real_escape_string($conn, $_POST['id']); $date = mysqli_real_escape_string($conn, $_POST['date']); $note = mysqli_real_escape_string($conn, $_POST
  6. The root problem is an ASPX (ASP.NET) web page program, part of an important business program presently in development and connected to an sql server database (.mdf) file, is presently unable to do two procedures: rs=Server.CreateObject("ADODB.Recordset") and rs.Open (sql1,conn). Both operations return rs.State = False. The reason is not clearly understood. The system is Windows XP SP3. The only error observed in the MSSQL ERRORLOG is: The SQL Server Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b, state: 3. Failure
  7. Hello, I want to do a countdown and put it in my website. I did a countdown but I have a problem, when I launch it, the seconds are freezing they are not anymore running... So the countdown is not in realtime anymore... I have to refresh in order to see the countdown running. Here is what I did: <div id="after"> <span id="dhour"></span>:<span id="dmin"></span>:<span id="dsec"></span> </div> <div id="count2">Texte à afficher</div> <div class="numbers" id="dday" hidden="true"></div> <script> var ladate = new
  8. I'm trying to learn PHP and CMS. But do not know how to learn. I need guidelines. If someone tells me how I can do, then I will be benefited. What will learn step by step?
  9. I'm trying to learn PHP and CMS. But do not know how to learn. I need guidelines. If someone tells me how I can do, then I will be benefited. What will learn step by step?
  10. Is there a way to prevent that a malicious person crafts a piece of code that changes the value of an action attribute? Like when you have this line of html: <form method="post" name="register" action="<?php echo $_SERVER['PHP_SELF']; ?>"> but the attacker places the entire script on his own server. Is this XSS? What are the consequences of gaining/finding protected data? If this kind of attack is possible, can someone show with an example how this is done?
  11. Hi everyone. So I am have an issue to were I am trying to send information to my database and I get this error: NOTICE: Undefined index This is the code I am using: index.php <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Test Page</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <form action="signup.php" methos="POST"> <input type="text" name="first" placeholder="First Name"><br> <input ty
  12. I'm going to get this out of the way right up front, I am very new at this PHP stuff. After a lot of research I have developed a standalone PHP file that I want to call from a HTML page. It isn't getting past my HTML code so I think I've done something there. This is my HTML code: <div class="visitor-count">Number of visitors since 12-10-2016:</div> <img alt="Hit counter" src="../javascripts/counter.php" /> Any help would be greatly appreciated. RPatton
  13. Hi all, I'm trying to execute a query which uses the value from my session which is set when the user logs in. When I try to view the query, it displays nothing. SQL statement // get value of session $username = $_SESSION['username']; // executeable query $sql = ("SELECT * FROM custstock WHERE username = '$username'"); // query $row = mysqli_query($custdb, $sql) or die(mysqli_error($custdb)); The code for my table; <table width="100%" border="1" cellpadding="1" cellspacing="1" class="carInfo"> <tr> <th>ID</th> <th>Vehicle ID<
  14. Dear all; Is there any technical difference between initially setting a variable to false or setting it to an empty value at the beginning of a script, i.e., $x = false; vs $x='';
  15. hi there, I bumped into the use of session_set_cookie_param() and was thinking about how to limit access for undesired users. Besides lifetime, I thought it would be effective to set the domain param. But how effective is this in real? Isn't it also possible to spoof domain names. (as a lot can be crafted ). is there any evidence this can be done and if so how to avoid it? Like cloaking domains or so or is that exaggerating and time consuming?
  16. Hi all, I have uploaded an image to a folder/directory and stored its size using the $_FILES['image']['size'] superglobal. While the image source size was reading 153kb, the stored size is 157317. Why there is a difference in size?
  17. Hello, I have created a java-script file which needs to see which check-boxes are checked and pass it to PHP Testing platform: Url: https://crezzur.com/test/backoffice/ Login: test@w3schools.com Pass: w3school When logged in go to the name " height " then next the "view" button click on the arrow and select "edit". there you will see a checkbox tree called "Available categories". So i need to find whats the issue for my JavaScript code not working. When you select a checkbox for example "Women" it should pass the variable to my php code when pressing on the save button. PH
  18. Dear all. For an image uploaded to a folder/directory and stored its name, type, and size in a DB table, what could be the merits of also storing its temporary name, noting that such temporary name is deleted by the server upon moving the image to the desired folder/directory?
  19. Hi all, In fetching a result from a table (below code), 1 is also printed after the fetched record (fetched record below). There is no 1 in the table, nor have I accidentally included it in my script. What is it and why does it appear? <?php require 'db/connect.php'; if($result = $db->query("SELECT * FROM user")) { if ($count = $result->num_rows) { $rows = $result->fetch_assoc(); echo '<pre>', print_r($rows), '</pre>'; } } ?> Array ( [id] => 1 [first_name] => Bill [last_name] => John [bio] => I'm a web developer [created] => 2016-11-21
  20. j.silver

    Error Reporting

    Hi all, I want to eliminate any possibility of error reporting to users as it hinders a risk of displaying valuable data to potentially dangerous people, so I am setting the error reporting to false (as shown below). I want to disallow error reporting on every page, including same in one location applicable to all pages, e.g. the config file. <?php error_reporting(0); require 'db/connect.php'; But at the same time, I want to see errors reported to me, e.g. via email. If instead of setting error reporting to false as above I only set the error reporting function to report to the em
  21. Hi all, <?php require 'db/connect.php'; $result = $db->query("SELECT * FROM people"); ?> I obtained a blank page running the above script, which indicates that everything is fine (path and table name are correct). I then removed the * from the query to see if it would report an error, but it did not. I added print_r($result); and run it. Nothing has changed. I included the * and run, it reported the number of rows and columns in the table. Why there has a been a lack of error reporting in this instance, noting that the ini file is configured to report all sorts of errors
  22. Hi all, I have an android application which communicates with a php page to insert data into mysql table. it was functioning well on an windows server. Recently we were forced to move the application to a linux sever for some other reason. After that some error is returned. When I cross checked every thing, no data is received from the android application to the php page. Android send data using post method. Content type is "application/x-www-form-urlencoded". Data is encoded using UTF-8 format. I can see the variables values correctly in android app. But when we fetch it in Php page
  23. Hi all, How is the performance and speed compare between a website that is coded with html 5, CSS 3, MySQL, and PHP 7 only and the same website but added to it js, jQuery, and JSON?
  24. Hi all, In one website, I read the following note: "You should also think about storing files locations on disk. Using MySQL for storing images is thought to be Bad Idea™. Handling SQL table with big data like images can be problematic." Do you agree? If not, why? What is the best practice in storing and displaying on a website a big number of images?
  25. Dear all, I have the following code for storing an image in and fetching it from a MySQL DB: <html> <body> <form action="index.php" method="POST" enctype="multipart/form-data"> File: <input type="file" name="image"> <input type="submit" value="upload"> </form> <?php mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("code_new") or die(mysql_error()); $file = $_FILES['image']['tmp_name']; if(!isset($file)) { echo 'Please select a file'; } else { $image = addslashes(file_get_contents($_FILES['image']['tmp_name']));
  • Create New...