Jump to content

tcorbeil

Members
  • Posts

    122
  • Joined

  • Last visited

    Never

Everything posted by tcorbeil

  1. The code isn't working.. keep getting errors.. Because I'm new to PHP, on a quick observation, I see on '(' at the start of the if but none at the end.. I added one at the end of the expression but still got an error.. then I took both out completly.. still no go.. Any advise? T
  2. Frost, i checked with the server info regarding PHP version installed and didn't see anything along the lines of PEAR.. I do know that CURL is installed... i hope i can avoid a bunch of script but if i need to, i'll look into it.., Thank you. T.
  3. I'll try that script Hell Toupee, thanks.. All i need is a basic, ping or check to see if the url is there, return result.. I'll let you know. T.
  4. Hey Frost. Thanks for your response.. Is there not a way to ping a link in a simple way?
  5. and yet another.. You guys are awesome BTW!! If I have a customer input in a string: $String = "oilers.com"; What I'm doing is storing the links but I want to vaildate it first.. How would I verify the $String is a valid link? T.
  6. Thanks mjlogan. Works like a charm!
  7. Hello gain. I am now looking for a way to go through a string variable, find any space that is present and replace it with _. How would I go about? The reason is I get input from a user.. lets say he/she loads a variable $Hockey = "Edmonton Oilers"; this variable is used to create a new webpage but of course, the web does not like spaces.. hence I would need this variable to be $Hockey = "Edmonton_Oilers"; Any help would be much appreciated. T.
  8. Hey kenrbnsn, your script worked very well, thank you.
  9. emehrkay, thanks.. but the link is not always going to be the same thing.. Would this still work?? And also, the amount of dashes in the link may vary aswell... can i still make this work somehow?
  10. Someone gave me this script to use: list(,$dir) = split("/", $_SERVER['SCRIPT_NAME']); basically what it does is this: If i have a path that is something like /oilers/oiler.php the above script removes the oilers.php part so that all remains is /oilers but... I have a problem if the path exceeds more than 1 dash .. ex /sports/hockey/oilers/oilers.php what remains is /sports... i need the whole link minus the running file.. eg, /sports/hockey/oilers ... Any idea as to how i could do this? Thanks T.
  11. Ok, sorry for the bother.. I got it... add this to the beginning of the script to create function.. if (!function_exists('ftp_chmod')) { function ftp_chmod($ftp_stream, $mode, $filename) { return ftp_site($ftp_stream, sprintf('CHMOD %o %s', $mode, $filename)); } }
  12. Hey fert. Your right... version loaded on the server is 4.4.4.... Do i have any alternatives?? T.
  13. Hey fert.. you lost me.. can you clarify? I have the following 3 lines in my script to which the 2 first ones work perfectly.. !ftp_chdir($connection, $currentdir); !ftp_mkdir($connection,$Subpage) ; !ftp_chmod($connection, 777, $Subpage); So basically, go to a specific directory, make a new directory and then make the new directory CHMOD 777. Any further input would be appreciated.. T.
  14. tcorbeil

    CHMOD

    Can't get this work guys... can you's help? !ftp_chmod($connection, 777, $Subpage); $Subpage is the variable that holds the directory name.. I keep getting this error: Fatal error: Call to undefined function: ftp_chmod() in ..... Thanks in advance.. T.
  15. I got it.... I wasn't going back far enough in the directory structure.. needed to start at /home/public_html/file.php where I was only starting at /public_html/file.php.. anyway, thank you for the suggestions.. my directories were set to 777.. T.
  16. <?php rename("/tmp/tmp_file.txt", "/home/user/login/docs/my_file.txt"); ?> ... I tried modifying the above to suite my directory structure.. can't seem to get it to work.. I was, however, successful in getting this to work when not having to change directories at all... Any ideas? Thanks. T.
  17. sorry.. after having read some more, it looks like the rename function would better suite.. ok, I guess my question is this: If i login to the server using ftp commands, can I then use the rename function? is the ftp_rename function the same thing?
  18. Also, could I put the paths in these variables such as: $file = "/public_html/Global/oilers.php"; $newfile = "/public_html/hockey/Oilers/oilers.php"; (!copy($file, $newfile));
  19. Lumio, thank you. I was hoping to do this in an ftp command but.. can you run by me how you would login to the server with this scenario? Or, is that i can login ftp style but still do what you pointed out? Thanks. T.
  20. Let's say I have a file on my server at location: /public_html/Global/oilers.php ...and i want to copy this file and save it to another directory (using ftp commands): /public_html/hockey/Oilers/oilers.php How would I go about.... I gigured out how to login using ftp commands and explored the ftp command available.. (eg.put, get etc..) but I'm not sure which command to use.. can someone point me in the right direction? Thanks. Note: I figured out how to login using ftp commands and such so.. i got that far..
  21. Frost your a genius! Thanks Man! T.
  22. Thanks Frost. I tried print_r($_SERVER); and seen all of the info.. none of the switch variable would give the path without the file running at the end.. can you elaborated on the split idea? Could I also not use a rtrim up until the first '/' it encounters? Thanks. T
  23. Me again... is there a way to get just the url? for instance if I have an address such as Domain Name/Oilers/oilers.html in every instance I do $path = $_SERVER['SCRIPT_NAME']; I get /Oilers/oilers.html If i just want /Oilers/ with the file running name at the end, how would I go about? Thanks. T.
  24. Here's a question: If I have a main page and wish to have a user click on a button with the intent to create a subpage of the main.. can this be done? Lets say I have my main page on my server in a directory called main, once the user clicks on a button, the contente of the directory called main is copied and pasted into a new directory which would be named by the user.. I know this may not be an easy task but if someon could point me in the right direction, it would be much appreciated.. Thanks. T.
×
×
  • 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.