Jump to content

ReeceSayer

Members
  • Posts

    97
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://reecesayer.com

Profile Information

  • Gender
    Male
  • Location
    Doncaster

ReeceSayer's Achievements

Member

Member (2/5)

0

Reputation

  1. As in the title - my PHP.ini doesn't seem to be working - I did move from a WAMP setup to an LAMP setup but i changed the files in my ini to reflect the different directories. I have the following set in my php.ini: include_path = ".:/var/sites/t/testing.indigoonline.co.uk/public_html/php" However, when i try to require the file i get the following: Warning: require_once(required.php) [function.require-once]: failed to open stream: No such file or directory in /var/sites/t/testing.indigoonline.co.uk/public_html/admin/index.html on line 4 Fatal error: require_once() [function.require]: Failed opening required 'required.php' (include_path='.:/usr/local/lib/php') in /var/sites/t/testing.indigoonline.co.uk/public_html/admin/index.html on line 4 It seems that the php.ini isn't having an effect - anyone have any ideas please? I know i'm probably just missing something really simple. Thanks
  2. Yes - I have but he wants to charge an additional fee - I'd prefer to solve this myself. I set the include_path in php.ini to the php folder which seemed to resolve most issues. I can see everything working perfectly on the front end and can now access the login page on the back end but i can't login. I'll ask the developer again to see what they can do. Thanks
  3. Hi, We've recently purchased a website at work and have it up and running on the previous owners server at a cost, we can't have FTP access to this for some reason so attempting any changes is a pain. I've got the files from the owner and am trying to set them up on WAMP to ensure that i can move over and setup / develop when needed. I received 3 files which i'll list below: SQL file SITENAME.com Folder PHP Folder Initially i thought that i should merge the php and sitename folders together (which i did) - this allowed the majority of things to work on the front end of the site but then when i went to go to the admin directory /admin/ i received a tonne of errors about missing filepaths etc. trying to resolve appears to lead me around 30 different files which i need to change a require_once function on. I'm thinking it's got to be easier than this but obviously i'm not entirely sure what i'm supposed to do with said folders? Anyone have any ideas? (and apologies if this isn't in the correct category.) Thanks, Reece
  4. Thanks works brilliantly, I've just used IGNORE when importing the data and set the jobrefs column to unique which also seems to do the job (i'm importing a different data-set every day and didn't want duplicates). Thanks again
  5. Maybe you were including the PHP without tags? Or the other way around... <LI><A HREF="productcat.php?cat=Gas cards<? $row['prodID'] ?>">Gas cards</A></LI>
  6. Hi, I'm trying to remove duplicates from my database table (vacancy). Currently using the following SQL statement: SELECT title, jobref, location, description, salary, apply FROM vacancy WHERE jobref IN (SELECT DISTINCT jobref FROM vacancy) However, this still brings back the duplicates, each statement works on its own (I.e. DISTINCT brings back unique values for that column, and SELECT * brings back all rows & Columns) so i'm not entirely sure why it's not working. If there's a simpler way of doing this i'm open to trying it out. Cheers
  7. Just an FYI. I've solved this issue it was due to using the incorrect case in a filename. Thanks
  8. It should have changed now i've edited the post, i copied it straight from Notepad++, not sure what the problem was. Thanks
  9. Hi All, I'm trying to set up some code to download a CSV file from an ftp host and then i want to do something with it. However, i can't quite get the code to work. I get the following error: Warning: ftp_get() [function.ftp-get]: Failed to open file. in /home/rsyr/restofthedirectories/ on line 8 Here's the code, excuse the messiness: <?php $today = date("Y-m-d"); $conn = ftp_connect("ftp.zois.co.uk") or die("Could not connect"); ftp_login($conn,"anonymous",""); echo "JCP-scrape-". $today; echo ftp_get($conn,"JCP-scrape-18-10-2012.csv", "/pub/jcp/JCP-scrape-18-10-2012.csv", FTP_ASCII); ftp_close($conn); //sql code to move data from holding table to vacancy table //INSERT INTO vacancy (title, jobref, location, description, apply) SELECT title, reference, location, description, apply FROM holdingtable //truncate holdingtable //Holding table should then be truncated ?> Thanks
  10. Yeah i understand a little better now thanks. Only one way i can think of doing it at the minute. Possibly wrap those if statements in another to check that both the user and pass GET variables are set before going into that verification. Like this: <?php session_start(); define('DB_HOST', 'localhost'); define('DB_USER', 'mydbusername'); define('DB_PASSWORD', 'mydbpass'); define('DB_DATABASE', 'mydbname'); $errmsg_arr = array(); $errflag = false; $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } $db = mysql_select_db(DB_DATABASE); if(!$db) { die("Unable to select database"); } function clean($var){ return mysql_real_escape_string(strip_tags($var)); } $image = clean($_GET['image']); $strings = clean($_GET['strings']); $username = clean($_GET['user']); $pass = clean($_GET['pass']); if (isset($_GET['user'])) && (isset($_GET['pass'])) { if($username == '' && $pass) { $errmsg_arr[] = 'username are missing'; $errflag = true; }elseif($username && $pass =='') { $errmsg_arr[] = 'PASSWORD are missing'; $errflag = true; } if($username == '' && $pass == '') { $errmsg_arr[] = 'username or password missing'; $errflag = true; } } if($errflag) { $_SESSION['ERRMSG_ARR'] = $errmsg_arr; echo implode('<br />',$errmsg_arr); } else { $insert = array(); if(isset($_GET['image'])) { $insert[] = 'image = \'' . clean($_GET['image']) . '\''; } if(isset($_GET['strings'])) { $insert[] = 'strings = \'' . clean($_GET['strings']) . '\''; } if(isset($_GET['user'])) { $insert[] = 'user = \'' . clean($_GET['user']) .'\''; } if(isset($_GET['pass'])) { $insert[] = 'pass = \'' . clean($_GET['pass']) . '\''; } if (count($insert)>0) { $names = implode(',',$insert); $required_fields = array('image', 'strings', 'user'); if($image && $strings && $username) { echo "working 1"; } elseif($username && $pass) { echo "working 2"; } } } Not sure if it's good practice to do it that way but i'm still learning
  11. The else if statement is checking if your password is set from the GET in the URL. If you don't pass it in the URL it will throw that error. If you don't want people to see the password in the URL you could use POST instead. If you want to get rid of it remove the elseif or set the $errflag variable to false. Probably defies the point though. Not sure exactly what you're trying to accomplish, sorry if i've misunderstood.
  12. No sorry i didn't mean like that. However, If you haven't already solved the issue it appears to be this: if((!isset($_SESSION['id'])) || (!isset($_POST['callname'])) || (!isset($_SESSION['username'])) || (!isset($_SESSION['email'])) || (!isset($_SESSION['password']))) { unset($_SESSION['callname']); unset($_SESSION['username']); unset($_SESSION['email']); unset($_SESSION['password']); unset($_SESSION['id']); $loggedin = 0; } else { $loggedin = 1; } You're checking for a post value when you should be checking for your session value instead. I've just tested it and it works as you want i think.
  13. Okay.... Only one thing i can think of off the top of my head. You're echoing out the variables and it seems to be missing double quotes / single quotes (i'm not sure if this has to be done and i don't have the time to test at the minute.) Try it the way litebearer did in his example. That way we can rule that out 100%.
  14. if you're pulling the email addresses from a database you could use get. So instead of linking to the email address it links to: myscript.php?email=example@example.com then you'd do something like the following: <?php //this would get the email and make into a variable. $email = $_GET['email']; ?> Then you'd include the email script here and a probably a textarea box. Once you click submit it would send an email to that user.
  15. You don't seem to be calling session start when you're setting your sessions in the log-in page. That's probably it.
×
×
  • 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.