Jump to content

THEK

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

About THEK

  • Birthday 06/02/1992

Contact Methods

  • Website URL
    http://mediaphillia.com

Profile Information

  • Gender
    Male

THEK's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. ok, I can see this is a little more tricky than I first thought. I'll have another look around the web.
  2. Hi, I'm completely new to LDAP authentication but have managed to get a fairly smooth working script. However, I was wondering what is the easiest way to get a BASEDN from a Fully Qualified Domain Name. At the moment I have a loop which would take: example.com and turn it into dc=examplem,dc=com But is that the best way?
  3. I tried that but it looks messy when I'm within several folders. dirname(dirname(dirname(dirname(__FILE__)))); When I do ../../config.php; it can't find it. But if I do ././config.php it can. Is that right? **EDIT** Found the problem. This is where I was talking about ajax issues. I use the same file through both AJAX and includes. I include it when the page loads and use ajax when they want to refresh it or a change is made. If I access it through AJAX I have to use ../../config.php But when including it I have to use ././config.php
  4. I have a config file that contains database information and some constants. This is generally included in every page. Including one's which are accessed via an AJAX request. My problem is I've only been testing on my website with the application running from the root directory so I was including the config file from all files like so: PHP Code: require_once $_SERVER['DOCUMENT_ROOT'].'/config.php'; This has a problem, as I picked up on in the first bit of testing, if someone installs it to say: WEBROOT/myApp/ The config file will be unreachable. My question is what is the easiest way to get around this? If I didn't use ajax I wouldn't need to worry about this because I could set the require statement in the main file and all the other includes would pick up on it. However, because I do use AJAX there are files within folders that would need different levels of dirname before getting to the right one. I was thinking of storing the root directory in a hidden input and sending that as data with the AJAX but is this the best solution?
  5. That was what I had but it said unknown host. This worked perfectly. I was putting it in quotes but it only works without them.
  6. Hi, I'm trying to connect to a database on a port other than 3306 to create a database. Here's my connect code: $connection = new MySQLi($host,$user,$pass) But according to the PHP website it says I can lay the code out like so: new MySQLi($host,$user,$pass,$database,$port) But how do I specify the port without the database? I've tried just "" as the database but the connection still fails. Any help would be much appreciated.
  7. Hi, I'm working on a project which was going pretty well until I discovered the application doesn't actually know where it is installed. So far when I want to include the config file I just use $_SERVER['DOCUMENT_ROOT'].'/config.php'; Which works fine if the application is installed in the root directory. But how do I get the folder the application is installed in? e.g. Document Root Folder: C:\Web\ Actually Application Folder: C:\Web\MyApp\ How do I get the \MyApp dynamically? I can't just use './' all the time because I have files accessed by AJAX stored in other folders. Thanks in advance.
  8. Thank you so much. After a bit of editing I now have a perfectly working CSV import system
  9. Hi, I'm trying to create a script that imports a CSV file but gives the user 3 options: 1. If Exists Update 2. If Exists Keep Both 3. If Exists Ignore New The keep both is easy, I just insert everything without checks. However, the other 2 are a little bit tricky (in my mind anyway). I've been told I could create loops and that there isn't any easy way to do this with MySQL. I cannot use ON DUPLICATE KEY because the column that I'm checking cannot be unique (because I have the keep both option). Is it efficient in PHP to create a loop that checks each row to see if it exists? I'm a little hesitant because the files could be big and I'm not sure how efficient PHP is with CPU and memory resources. The App I'm making is designed to run in a business environment but it may run on servers that are handling more than one thing (not just web services). If anyone could give me a few pointers I'd be most grateful. Thanks.
×
×
  • 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.