Jump to content

Eritrea

Members
  • Posts

    25
  • Joined

  • Last visited

Posts posted by Eritrea

  1. Just learn by trying to build something.  It's much more practical to learn this way, as you'll go through the headaches of trying to do something and not know how. Through these experiences you'll figure some stuff out -- hopefully.

     

    Thanks for the reply Mahngiel, but I have done a lot more than building something actually. As, I have made a fully-functional news publishing website, with comments, poll, user profiles, and so and so, plus, a classified-ads site that works similarly with other add sites, but the problem, is that, these sites are made with spaghetti code, your know, even if they can get the job done, I need them to be on just like professionally made, with debugging, micro-optimization... 

     

    I just need to know more than creating CMS's and scripts. 

  2. Sorry, for the rather-misleading title, 

     

    But, I am a noob, and have been in self-teaching for the past 8 months, and I already know the basics, used mysql_ then changed to PDO, and I am learning OOP now. But, the problem is... there seems to be many things to learn in PHP, aside from PDO, OOP and the basics. Can anyone list them here, according to their difficulty level.

     

    Because, I want to learn more, but I don't know where to start. PHP unit, MVC, framworks, .... 

     

     

    Hope, someone got the idea

  3. I just don't get it. If you protect the above two, other than server hacking, or if you have file uploads,

    what other ways are there for a user to hack your site. Even if the user knows the directory structure of the site?

     

    I built my site, and I'm about to upload it, My hosting company is one of the best, and I don't have file any uploads in the site, So, what more would you watch out for, if you were in my solution?

     

     

    btw, I am using mysql so, by inputs I mean all (GET & POST ) are protected with regex, htmlentities, mysql_real_escape_string()

     

    functions.

     

     

     

     

     

     

     

    thanks in advance

  4. I have a page something like: www.site.com/ref.php/index.php?user=John

     

     

    I need the above to be changed, to www.site.com/ref.php/john

     

    I have .htaccess file in the root directory and inside it, there is this code:

     

    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*)$ /url/index.php?username=$1

     

     

    But when I browse the page: www.site.com/ref.php/john it is giving me a 404 error

     

    it must be a simple mistake, because I totally know nothing about url re-writing.

     

    thanks for the help

  5. In my site, I have a functions.php file and I store all functions for the site ( A news site, with memberships, profiles )

    So, I am still making the site, and 80% is finished, but the I feel like the file is going to slow my site down, I just checked it and I have reached 500th line on notepad++.

     

    So, I just want to know how much is too much really. What is the effect, or the best practices when putting all your functions in one file.

     

    Suppose, this for instance. There are functions that are used 10 or 20 times more than other functions. In my case, every time user browses the index page, there will be atleast 1 function that will be started. ex: ( out putting an article. ) And, there are others functions that rarely get called, like user registration, login....

     

    So, is it ok to separate functions in different files according to their time of use? or not?

     

     

    I generally want to know, ( Since I am newbie ) how you deal with functions, and the best methods.

     

     

    Thanks.

  6. Suppose there is a url ex:

     

    site.com/page.php?id=*ANTHING*

     

     

    How do you check if *ANYTHING* is only string ( not composed of strings and integers ) or integer only.

     

     

    Because, I used is_string() function to check it, but it only checks if the first letter is a string so

     

    id=?cat435 and id=?catdasd will return the same result.

     

     

    How can I make sure, if a value is then only a string or integer and not a combination of both

     

     

    thanks

  7. This is the structure of the file.

     

    <?php include database file ?>

    <link style shit or css here >

    <?php php file inside there are login queries and login checkers or the script above mentioned ?>

    <?php include an html file containing the html form only for login site users ?>

    <div simple html for footer of the site. ?

     

    Now the problem is happening at the line three, with is called login.php and contains nothing except

     

    - check if user is log-in and die

    - if user is not logged in, then autheniticate his/her input with database

    - If user exits then, perform:

    - header("location: loged-in.php")

     

     

     

    I keep asking about this problem, and always the same answers. I can't understand it. This thing is driving me crazy. I've never struggle to know about PHP as much as I am doing about header errors.

  8. Hi. I am designing a CMS site, And in localhost, there are no errors even though error reporting is on and I can see many errors. But, " header already sent " are not visible, and when I uploaded my site online, I am starting to see all these errors. Is there something I am doing wrong with XAMPP?

  9. else if(mysql_num_rows($result)==1)  // <-- If ONE row is returned
    
       {
    
       $my_session = mysql_result ($result, 0, 'u_id'); // <-- then user is Authentic & Start session
       $_SESSION['clans'] = $my_session;
    
       header('location:../FINAL/index.php');  
    
       }
    

     

    As you can see the above, it is a script for a log-in page, basically saying that if row is returned from my MySQL then take user to index page.

    Unfortunately, I am having a header already sent error.

     

    For two days, I have tried to figure out this problem but no hope.

  10. Hi everyone. I am new to PHP and this form.

     

     

    I am trying to create 10 questions in my website with PHP, in which a user will only answer just by using radio buttons, after submitting all,  he will be able to see how many answers he/she got right/wrong.

     

    Now, what I need to know is that, how do you make PHP count all the right/wrong passwords and display message like: You've got 4/10 or 9/10....

     

    How do you make an array ( If I am correct ) to count right/wrong of all submitted values in PHP??

     

     

    I would like a simple example on this one.

    Thanks for the help in advance.

  11. Yes, like the posted above has told you, you need AJAX it is another scripting language more complex that HTML. It is very similar to javascript

     

    This is a grate place to begin learning

     

    http://www.tizag.com/ajaxTutorial/

     

    Good luck.

     

    And, I would suggest instead of your idea, you should make a little submit button named NOT "submit" ( <input type="submit" name="check_username" )

    to search for existing usernames.

     

     

×
×
  • 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.