Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/18/2022 in all areas

  1. Not sure what you mean by "not getting"? One thing that's important to understand is that url's involve "web space", not filesystem space on a workstation. If you use FILE|OPEN with your browser, the browser goes into a local mode where it will parse html etc, and will work with local files and paths but rarely do I see this use case. Since I'm not sure what the purpose of your current scripts are, it's hard to say, but a URL is not a filesystem path. Is this code meant to be accessed via a browser? Then your URL's need to be within webspace, and not reflecting a file system path. Just for clarity, even with what you have, it's odd, and you introduce a space where you probably need a directory separator. If you are using interpolation, then use it. Maybe? echo "<a href='$latest_dir/$latest_file'><button>continue</button></a><br>"; With that said, this should only produce a url with a local filesystem path, and only usable by a browser in local mode, which is almost never what you want to be using PHP for.
    1 point
  2. try echo "<a href='$latest_dir $latest_file'><button>"."continue</button></a><br>"; ^ ^ ... adding the single quotes, otherwise the href finishes at the space. (Are you sure you want the space?)
    1 point
  3. Not sure what is supposed to happen so I did a bit of reorganization of your code to help understand it better. $store_path = './'; // save to folder above current $name = date('ydhis'); // use a name of yyddhhmmss if(!is_dir($store_path . $name)) { mkdir($store_path.$name); // make a new dir above current using current time echo "Dir $store_path$name has been created<br>"; } else echo "Dir $store_path$name already exists<br>"; // dir already exists. How? $filename = $store_path . 'starttoken.php'; if (copy('tokenmaster/starttoken.php', $filename)) echo "Copy to $filename was successful<br>"; else { echo "Copy to $filename failed<br>"; exit(); } $date = new DateTime(); $newname = "./tokendone" . $date->format('ydhis') . ".php"; if(rename($filename, $newname)) echo "Rename of $filename to $newname was successful<br>"; else echo "Rename of $filename failed<br>"; $savename = $store_path.$name.'/'.$filename; echo "Attempting to save some data to $savename<br>"; if(file_put_contents($savename, $yourcontent) === false) echo "Save to $savename failed<br>"; else echo "Save to $savename succeeded<br>"; exit(); Run this and see what messages you get.
    1 point
  4. COALESCE() comes in useful here SELECT ... FROM tablename WHERE COALESCE(colname, '') = '';
    1 point
  5. In addition to the above, I find PHP DocBlocker, Better Comments, Auto Close Tag, and Auto Rename Tag pretty necessary to my setups. There's a number of format and syntax plugins that I use for other languages but I would hate working in VSCode without these and Intellephense (just make sure you follow gizmola's advice).
    1 point
  6. No worries my friend, your passion and desire to produce is very evident, and speaking for most of the regulars here, we invest time here to try and help people like yourself who are working hard at building up their expertise.
    1 point
This leaderboard is set to New York/GMT-04:00
×
×
  • 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.