Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Again, I am sure this is something obvious I am missing here...
  3. I got the DB and the entry to go in, as shown... will I need to create something in regards like a connectdb.php? cause the output on the php page is giving an error when I run this script and I know its just showing part of the code... maybe I am missing something in the obvious here... error I get $tdata = ''; foreach ($res as $r) { $tdata .= "{$r['userid']} {$r['fname']} {$r['lname']} " . drawImage($r['sign_x'], $r['sign_y']) . "\n"; } function drawImage($xcoords, $ycoords) { $xa = explode(',', $xcoords); $ya = explode(',', $ycoords); $w = max($xa)+10; $h = max($ya)+10; $path = "M $xa[0] $ya[0] "; unset($xa[0], $ya[0]); foreach ($xa as $i => $x) { $y = $ya[$i]; $path .= "L $x $y "; } $im = maybe a version conflict? just trying to replicate your demo...
  4. I won't when i get your solution implemented. I currently have a pw on the root via the method I just showed you, using goDaddy's tool in that image. but that doesn't work, as stated.
  5. Today
  6. I *do* have the option to password protect different directories, however I tried this long ago and it doesn't work because if I protect the root and then protect a subdir underneath that root with another pw, the pw for the root is used for both. the pw for root takes precedence over every other one. thus, goDaddy's tool can't do this. see attached image, or here: https://drive.google.com/file/d/1RF8KnyP5tKzdG-R0Axrr116E-L-iYeFr/view?usp=sharing
  7. You have a directory called ".htpasswds" that already exists? Then there is some mechanism already in place to do what I'm talking about. Do you see anything about password protecting directories in CPanel?
  8. that looks like something similar to what I need, req. however, a part of that page says this: this website is hosted with GoDaddy, and I have no idea if I have access to that dir or those appropriate files. this is on a shared server, and goDaddy tells me that access to deep level config files under that kind of hosting account is not possible. the root dir on this website, per an FTP client, is: public_html however, there *is* a directory underneath that root called: .htpasswds the apache version they have is 2.4.33 it looks like we're on the right track then here, no?
  9. Yes, it's true that we do like quick answers, but only to quick questions: very often the background information is not just useful but even significant and can affect what advice should be given. Your criteria are that you have an authentication system that is applied for individual directories where one username and password (each) is sufficient, and that you are using Apache. Right? https://cwiki.apache.org/confluence/display/HTTPD/PasswordBasicAuth You can set up a single file containing all the information for all the directories, each one with a different "username", then instead of Require-ing any valid user, you require the specific "username" for that directory.
  10. YES. sorry for the long winded answer, requinix. I know you tech experts like it simple in the manner of "question-answer". 😃
  11. So the answer to the question I asked is "no, I do not want a different username/password for each person". Let's try another one and see if we can reach the answer with fewer posts this time: Are you using Apache?
  12. ajoo

    string checks

    hmm, So I can finally use isset($_POST["whatever"]) && is_string($_POST["whatever"]) && trim($_POST["whatever"]) != "" because, as you said, if it's a string, it won't be false or null. Thanks.
  13. well here's what it is, requinix.... .....I have a site that has "index.php" files inside each subdir. so the architecture looks similar to this: www.domain.com => www.domain.com/concept1/program1/ => www.domain.com/concept1/program1/advanced => www.domain.com/concept1/program1/tutorials => www.domain.com/concept2 ....(same as above) so....someone will contact me that is trained in program1 and want to learn more about that program. I would then want to give them access to these dirs ONLY: www.domain.com/concept1/program1 www.domain.com/concept1/program1/advanced www.domain.com/concept1/tutorials but I would *not* want that same user to have access to these dirs: www.domain.com www.domain.com/concept2 so....is this even possible with PHP/MYSQL?? in general, the password given to this examples user I'm referring to in this post would be the exact same password given to anyone that wanted to learn about program1. thus, it would *not* be a different password for each person. but rather, a different password for each *dir* and its associated *subdirs*. thanks requinix!
  14. It will be either a string or an array. If you want to protect against that, a simple is_string() will suffice.
  15. Try $msg = "<script type="text/javascript"> $(document).ready(function(){ demo.initChartist(); $.notify({ icon: 'pe-7s-gift', message: 'TESTING!' },{ type: 'info', timer: 4000 }); }); JS; print '<script>'.msg.'</script>'; P.S. Your code is not safe. Use PDO instead MySQLi.
  16. ajoo

    string checks

    Hi ! @ gw1500se : While it's complicated I don't think it would require a regex since it's also basic. @requinix : Since this is an input received via ajax, someone can try and doctor the input to try and break the code. Hence I had the == false as well. And since a string won't be equal to false, I am thinking that it may be necessary to check that the input received is indeed a string. Wouldn't that be so ? Would you still go ahead with your code that you pasted above? Thanks !
  17. I am trying to model "Plans" and "Entitlements" for my website, and could use some help on adding "Versions"... For my website, "Members" can purchase various "Plans" which in turn give them different levels of access. And now I want a way to track how a "Plan" might evolve over time. Here is what I have so far... PLAN -||------|<- PLAN_VERSION -||------|<- ENTITLEMENT ->-------||- WEBPAGE PLAN - Silver - Gold - Platinum PLAN_VERSION - Gold, 1/1/2019, 12/31/2019, v1 - Gold, 1/1/2020, 6/30/2020, v2 - Gold, 7/1/2020, 9/30/2020, v3 - Gold, 10/1/2020, 12/31/2020, v4 ENTITLEMENT Gold v1 Feature-01 Gold v1 Feature-02 Gold v2 Feature-01 Gold v2 Feature-02 Gold v2 Feature-03 Gold v2 Feature-04 **I added the "version" above to show what I am trying to do, but as you can see from my question below, I would actually use that for the key, and would prefer using a Start and/or End-Date. Questions: 1.) What should I use for my Primary Key in the PLAN_VERSION table? Plan-Name + Plan-Start-Date ? Plan-Name + Plan-Start-Date + Plan-End-Date ? Something else? 2.) What can I do to prevent the Plan-Start-Date and Plan-End-Date from getting mixed up between different records in PLAN_VERSION? For example, you wouldn't want to allow this... - Gold, 1/1/2019, 12/31/2019, v1 - Gold, 12/5/2019, 3/1/2020, v2 - Gold, 1/1/2020, 9/30/2020, v3 3.) Any other suggestions on setting this up? Thanks!
  18. So, I have part of this snippet of code in my homepage and it pops up an inner window notification that briefly displays and then goes away...I'm looking to do it for a non-index.php page and it just isnt working. In the index.php page, it automatically occurs when the form loads and in this case, I need to invoke it...any help would be awesome.. It is the section where I'm echoing the JS script that isn't working. <?php if($_GET){ if(isset($_GET['add'])){ /* Attempt MySQL server connection. Assuming you are running MySQL server with default setting (user 'root' with no password) */ $link = mysqli_connect("localhost", "root", "test", "vendors"); // Check connection if($link === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); } $name = mysqli_real_escape_string($link, $_REQUEST['vendor']); $company = mysqli_real_escape_string($link, $_REQUEST['company']); $type = mysqli_real_escape_string($link, $_REQUEST['type']); $email = mysqli_real_escape_string($link, $_REQUEST['email']); $soc = mysqli_real_escape_string($link, $_REQUEST['soc']); $status = mysqli_real_escape_string($link, $_REQUEST['status']); // Attempt insert query execution $sql = "INSERT INTO vendor_data (name, company, type, email, soc, status) VALUES ('$name', '$company', '$type', '$email', '$soc', '$status')"; if(mysqli_query($link, $sql)){ echo ' <script type="text/javascript"> $(document).ready(function(){ demo.initChartist(); $.notify({ icon: "pe-7s-gift", message: "TESTING!" },{ type: "info", timer: 4000 }); }); </script>'; } else{ echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); } // Close connection mysqli_close($link); } } ?> <!doctype html>
  19. Thanks for making an account here and notifying us that you had a question and asked it somewhere else. We'll be watching that carefully.
  20. If it's a string then it won't be ===false. Because it's a string. Same for ===null. Maybe what you're looking for is isset($_POST["whatever"]) && trim($_POST["whatever"]) != ""
  21. You have two forms, one to let you open the file and another to let you save contents to the file. The first form has the filename, the second form has the file contents. The question for you is: why would the second form also have the filename? You didn't put a filename in there. It's just the textarea. Your browser isn't going to take the filename from the first form and include it in the second form's data. So put both into one form. Filename and file contents. Put the two buttons into the form too. Since it's just the one form now, you'll need a different method to determine what your code should do. Solve that by giving a name to your button, and you might as well use the same name for both since the user can only click one of them, then checking (a) if $_POST has that button and (b) what value it has. Side note: <button> buttons are better than <input> buttons. <button type="submit" name="action" value="open">Open</button> But before you do any of this, open up your php.ini (should be where you installed PHP), find the error_reporting and display_errors settings (the real settings, not the ones that are part of the documentation inside the file), and set them to error_reporting = -1 display_errors = on Then restart your web server and try running your code as it is right now. You should see a number of error messages. Do the changes I said above and run it all, then if you still see errors you need to go in and start fixing them.
  22. Yesterday
  23. I am using a form with a text area to change the contents of a text file. The file itself is chosen from a dropdown menu that is also used to open the text file of choice. When I try to use file_put_contents to overwrite with the submit method, the variable containing the name of the file chosen becomes null/nothing/get removed, so file_put_contents cant overwrite the file due to the directory being incorrect.
  24. My issue is detailed here: https://stackoverflow.com/questions/60145918/error-when-compiling-static-php-7-install-with-postgresql-10-11-3-support-on-rhe Thanks in advance for any help on this one, XFactor77
  25. Yes, a different username and password for the different directories, but do you also need a different username and password for each person? If so, how many people and do you need a full user system where they can log in and change passwords and whatever, or can you simply assign them passwords and that's the end of it?
  26. What do you mean by "save the changes"? What is supposed to be saved? Where?
  1. Load more activity
×
×
  • 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.