Jump to content
Larry Ullman's Book Forums

All Activity

This stream auto-updates     

  1. Today
  2. Hi Larry, I want the front end to be C++ so that I have access to the PC file system. Apparently it can be done with cpprestsdk and I will check it out. I wonder if I could do it the other way around with PHP on the server calling a C++ module on my PC to get access to the PC file system? I want to access a directory on the PC which, apparently cannot be done with PHP or an HTML form. I want the full path of the directory, not an upload. Re being comfortable with PHP - yes you are right on that count but I'm learning a lot more of C++ particularly using Visual Studio as the IDE which has nice PC forms functionality. Thanks for your reply. Cheers
  3. I imagine it _may_ be possible but it's the kind of situation where I feel like the answer is "this is probably not what you should be doing". In that it feels like you're only using PHP here because you're most comfortable with it. If you're starting with C++, my inclination would be to try to do all the work in C++. But let me know if I'm missing something.
  4. Last week
  5. That should be "I did something like this a few years ago with Adobe AIR and FLEX....". leveraging both your AIR and FLEX books. Cheers
  6. Hi Larry, Is it possible to have a Windows Form in C++ 'communicate' with a PHP back-end with all functionality being on one PC? I.e., the implementation of PHP in my case would be via XAMPP. Specifically I'd like to have a C++ Windows Form as that has access to the PC file system, and then pass some data from the PC file system to a PHP back-end which would do some work on the file passed to it. Once the work was done then some communication back to the Windows Form front-end to say that the work had been done. I did something like this a few years ago with Adobe AIR as the front-end and PHP as the back end, but would now like to do something similar but with the Windows Form C++ as the font-end. Looking forward to your advice. Cheers from Oz.
  7. Page 322 step 6. Remove the period at the end of all the error cases since print already has it: print '.</p>';
  8. Some of my fellow students had trouble with file permissions. On the end of page 301 "You may be able to change..." could use a better explanation of how CHMOD works in an FTP client. You must select or highlight the file on the remote server and find the "permissions" option in the FTP menu. Might be a good time to introduce fileperms() so us students know what the "system error" is.
  9. Just a thought... The date() and time() functions are easy for beginners to grasp and could be introduced earlier in the book (Chapter 4?) with programs to calculate a person's age or elapsed time to solve a math problem.
  10. I am having the same problem however if i run my sql code on the DB it works. <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <?php // put your code here $user_name= "11"; $conn = mysqli_connect('localhost', "root", "", "Invoices"); if (!$conn){ echo "Cannot find database"; } else { $mysql1 = "SELECT `Invoice_ID`, `Served_by`, `Date_served`, `Time_served`, `Cost` FROM `payment` WHERE `Invoice_ID` like '.$user_name''"; $result = mysqli_query($conn, $mysql1); mysqli_store_result($conn); $numrows = mysqli_num_rows($result); } if ($numrows > 0) { echo "Login succesful"; } else { echo "User not found or invalid credentials"; } ?> </body> </html>
  11. Earlier
  12. Never mind I got the problem solved, I had to remove the <?php, ?> tags and now it looks exactly like figure A. Thanks for the help HartleySan and Larry Ullamn.
  13. I got the link to work and the text to appear but when the site opens I get the PHP Version 7.1.8 screen that lists the system, build date, etc when all I want is the text "this is the standard html" like in the figure A example on pg 4
  14. If you put the file in a folder named "ch01" then the URL would be http://localhost/ch01/first.php.
  15. My first.php file is stored in a folder called ch01 the path to it is xampp/htdocs/ch01 and I had Apache running when I tried entering the http://localhost/first.php for the script but I still get the 404 error
  16. A 404 error is a page-not-found error, which means that your server cannot find the script in question. In other words, the URL to the file is probably incorrect. Within the xampp folder, where is the script stored, and is your Apache server running? Thanks.
  17. Hi Larry Ullman, I'm having some trouble on pg 4 step 6 where I run the first.php file. Whenever I run the file using the link http://localhost/first.php I end up getting an error message saying Object not found followed by error 404. Do you have any advice on what I should do. I also stored my first.php file in xampp/htdocs/ch01.
  18. I'm aware why I'm getting the warning. Do you mean change my entire website as every page includes the header file and will therefore echo the page title. For example remove the echo and hard code the <html> <title> tag? If there is an example of how such as page should be structured I would be grateful for direction.
  19. There could be several reasons why. To debug it, you'll want to take the src value for the img (from the browser HTML source) and run that directly in a browser to see what, if any, PHP error is reported.
  20. I noticed the same thing and my image would not display on the view_print page. is there a reason why?
  21. kbear, are you using some third-party library or did you build the slide-out yourself? If it's the former, then you'll have to check the documentation for the library, as there's likely an option to prevent it from sliding in/out on page load. If it's the latter, well, that's your code, so you'll have to program whatever you need to stop it from happening on page-load.
  22. You will get that warning every time you try to use the header function after you've already echo'ed stuff in your code. The code will have to be reorganized so that the header functions all come before any echo statements, then you should be fine.
  23. In chapter 3.2 the code was introduced: <title><?php echo $page_title; ?></title> Having now contructed a website based on this I'm having error now using the header() function such as redirecting and form submission. Each page includes the header file and defines the page title: // include the header file: include ('../includes/my_header.inc.php'); // Create the page title: $page_title = 'My Page Title'; //line #13 Whenever I use the header() now I get this error: Warning: Cannot modify header information - headers already sent by (output started at /home/mydomain/public_html/includes/my_header.inc.php:13) Is there a way round this or do I have to redesign the website?
  24. Thanks for the information! Could you clarify what edition and version (e.g., print) you're using? Thanks!
  1. Load more activity
  • Create New...