Jump to content

airbrushtutor

Members
  • Posts

    3
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

airbrushtutor's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi Guys - I'm in the midst of a guided tutorial with headfirstphp - i've finished the tutorial and uploaded it to my server and all works fine + as intended, however it doesn't work correctly on my local machine, when run with xampp. I get the following page error: Warning: move_uploaded_file(images/pacosscore copy 2.gif) [function.move-uploaded-file]: failed to open stream: Permission denied in/Applications/XAMPP/xamppfiles/htdocs/headfirstphp/addscore.php on line 32 this tells me that it's a permissions error, however i've made sure that all permissions for all users are set to read & write.. so i'm wondering if this may be caused by some other problem? Please let me know if you need to see the code? I don't believe you will need to as it is functioning, it's just a xampp/ localhost problem with moving the uploaded file.. any help of where to look would be appreciated as it would be useful to have a fully functioning application on my local machine:)
  2. Thanks very much for that Barand - it's such a concise & simple answer yet i couldn't come up with that myself. I guess it's just practise. i haven't seen the 'mysqli_fetch_assoc' or ' mysqli_num_rows' functions before either so i'll have to check them out. I really appreciate your help, thank you for that
  3. Hi Freaks! I'm writing my first script from scratch.. best way to learn from everyone's advice i've seen. My goal is to create a form whereby an individual inputs a username and email (these are then put into the variables $username and $email using the $_POST superglobal. The part i'm stuck on is trying to sort through an existing database and check if the username exists, then i'd like to check if the email matches. All i'm trying to do is validate that they already exist in an existing table. If they don't, then i want to echo a message that says 'you must already be a member'. The following is only a snippet of the code - the web form and previous mentioned variables are both working fine. <?php //Now check to see if these details are correct as per the airbrushforum database //Connect to the database $dbc = mysqli_connect('localhost', 'XXXXX', 'PWgoesHere', 'database name') or die('Error connecting to MySQL server'); //Create the query and select all fields from the 'user' table $query = "SELECT * FROM user"; $result = mysqli_query($dbc, $query) or die('Error querying database'); //Create a row to loop through all results $row = mysqli_fetch_array($result); //Use a conditional statement to validate the email address and username - if either is incorrect then //echo a message //the following code is executing and echoing a list - how do i instead sort through the data to check //the $username and $email variable against what is in the database? do { echo $row['userid'] . ' ' . $row['email'] . '<br/>'; } while ($row = mysqli_fetch_array($result)); ?> //This is the basic conditional statement i need to check my data. (right?) if ($row['username'] == $username && $row['email'] == $email) { //Execute the rest of the code here } else { //echo that they must be a member of the airbrushforum. } Can't figure out if i should be using a foreach loop? if i should be looping a conditional statement? advice? If i've been unclear with anything i'm sure you'll let me know but please have patience with me, I don't seem to be picking up PHP as fast as i'd like to..
  4. Hi everyone, very new to php but keen to learn. have been studying it at home using books i've bought and through tutorials, just looking to add interactivity and simplicity to my website.. no background in programming so the more i try to learn the further away i think i am. Thought i'd sign up here to seek help from others and hopefully improve my knowledge! Thanks for the help in advance!
  5. :)Hi everyone. My name is Mitch and i'm getting into PHP because i want to add functionality to my static website. i've been studying it in my spare time for about 4 months now, just reading and doing online tutorials. to be honest with you it's not getting me far and i don't know if it's teaching me that i'm dumber than i thought or simply that it's difficult to learn. I do airbrushing in my spare time and have a growing Vbulletin forum, however i'm here with the intention to learn as much as possible and actually hit the ground with my feet. look forward to growing and hopefully learning off some of you:) see you around!
×
×
  • 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.