Jump to content

AlphaWolf

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Everything posted by AlphaWolf

  1. Hi, I'm using the form data type 'date', and trying to verify it. It seems a little too complicated to check that it's in the correct format (with "/" between day/month/year), unless I use regular expression, which I don't know much about and seems feels like there's an alternate solution or it's not necessary. Currently, the script accepts DD*MM*YYYY, where * is any character, since it just strips the 3rd and 6th character and checks the day/month/year using checkdate(). I'm not even sure if this is a problem. I am giving the user a "verify" page, where I could put it in the correct format (DD/MM/YYYY), but is that enough? Feel like I'm missing something here, so any feedback would be great
  2. Hi, I'm still in the "starting" phase of using PHP, but I made a little bit of login system to test my skills and learn new functions. I'm hoping the system is secure, easy to use, and can be used by someone. Since this is my first script, I wouldn't mind some feedback on technique, efficiency and security I don't know if anyone will find this useful, but I'll release it when it's finished (if people want it), since I know I'll find it useful not having to make a new login system every time! Download here. You'l need to change the database connection info in functions.php, and then run createbatabase.php to create the DB needed.
  3. I'm not longer that bothered about replacing any domain suffix (Is it domain suffix or URL domain?), I'm happy with the way it is. Can you give me any pointers on how to "replace with an end of string anchor on the hostname"? I'm assuming this would change "www.commedy.com/funny/.com" to "www.commedy.co.uk/funny/.com"? Thanks for all the help, much appreciated! Joseph Duffy
  4. Current Code: // Get the current tab's URL. This URL can be undefined if the // page is blank or the user is at a page like Top Sites. To // get the URL, the extension must have permissions to access // the page at that URL. The Web Site Access Level setting in // the Extension Builder controls this. This particular extension // wants an access level of "All" so that it can change all URLs. var currentURL = event.target.browserWindow.activeTab.url; // Sets convert1 to the users prefernces, alowing changes of .co.uk, .fr etc. var convert1 = safari.extension.settings.URLSettings1; var convert2 = safari.extension.settings.URLSettings2; if (currentURL) //Converts URL 1 (Default .com) to URL 2 (Default .co.uk) if (currentURL.indexOf(convert1) !=-1) { event.target.browserWindow.activeTab.url = currentURL.replace(convert1, convert2); } if (currentURL.indexOf(convert2) !=-1) { event.target.browserWindow.activeTab.url = currentURL.replace(convert2, convert1); } Thanks for the swift replies and help!
  5. I've just tried my current code on "www.companies.com". It changes it "www.co.ukpanies.com". Interesting that it doesn't make it "www.co.ukpanies.co.uk" :S I'm thinking to ask it to change the last one (Although it could have "www.domain.com/something/.com"?), or the second one, so it will only ever change the correct one? I don't think you could have "subdomain.com.domain.com"?
  6. I can't find a way to get the two too interact :S I'm thinking this is a lost cause, no idea how to do it. Maybe if it wasn't a Safari Extension
  7. Hi, I've got the following code: if (myVolume == '.co.uk') { event.target.browserWindow.activeTab.url = currentURL.replace(/\.com/ig, ".co.uk"); } I would like to alter it so it changes any URL Domain, and not only .com. I've looked around, but can't find a solution. Thanks, Joseph Duffy
  8. I believe cookies are restricted, although it might be possible to bundle a txt file with the package, but then editing and uploading that it an issue D:
  9. Maybe javascript. I've posted on a Javascript forum, with no reply, although Javascript was my first option. It's primarily written in Javascript, so I'd love to use Javascript
  10. So, can this be done? Is there anything in HTML that can execute a file somewhere. I'm thinking this is impossible, but I'd really like to implement this
  11. Hi, After looking at some Javascript, I think it can only be done in PHP. I'm trying to get my script to add a "1" to an external file. It's made in Javascript, but I hope I can put some PHP in it, even if it's at the end. I'm working on a Safari Extension, and would like to know how many people use it. It's all made in a .HTML file, so I should be able to add a PHP script at the end. I hope this is clear, and I hope it can be done in PHP, or something at least. Thanks, Joseph Duffy
  12. Hi, I'm trying to make something that changes a web page back and forth. I'd like to to check what the domain already has in it, so it can change it correctly. I'm currently using if (myVolume == '.co.uk') { event.target.browserWindow.activeTab.url = currentURL.replace(/\.com/ig, ".co.uk");} I'd like this to check "currentURL", and IF it contains .co.uk, then replace with .com, if it contains .com, then changes it to .co.uk. I think I'm missing something simple here, but I can't figure it out Thanks, Joseph Duffy
×
×
  • 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.