Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Posts posted by wildteen88

  1. At the moment you're using absolute file paths for including the bbcode parser. However the parser itself is only using relative file paths. Example

                @include_once 'HTML/BBCodeParser/Filter/'.$filter.'.php';

     

    Maybe try adding /home1/elvonica/php/ to your include_path. Eg

     

    ini_set('include_path', ini_get('include_path').':/home1/elvonica/php');
    require_once 'HTML/BBCodeParser.php';
    $parser = new HTML_BBCodeParser();

     

  2. Does the file Basic.php exist in /home1/elvonica/php/HTML/BBCodeParser/Filter

     

    The function HTML_BBCodeParser() is trying to load the basic filter. For some reason PHP is unable to read/find the basic filter. This is why you are getting the error message.

  3. Your while loop is not constructed correctly. $i = 0; should be on the line before the while loop.

     

    Also you could just let MySQL add up the followers using the SUM() mysql function

    $query = "SELECT SUM(followers) AS total_followers FROM user_profile";

    Then you can get the total using $row['total_followers']

  4. I'm sure there's a more efficient way, but you could get the extension by exploding the filename with the dot '.'

     

    <?php
    
    $file_parts = explode('.', $image);
    $temp = count($file_parts) - 1;
    $ext = $file_parts[$temp];
    
    ?>

    Or use pathinfo

    $ext = pathinfo($image, PATHINFO_EXTENSION);

  5. When using the serialized array in your query you should first pass it to mysql_real_escape_string.

    $abc= mysql_real_escape_string( serialize($real) );
    $dql = "INSERT INTO countrytype (`ID`,`fromcountry`,`tocountry`) VALUES ('','".$abc."','".$abc."')";

     

    When you are retrieving the serialized array this line is not needed, remove it.

    $des=explode(",",$row['fromcountry']);

     

    This line

    $des=unserialize($row['fromcountry']);

    Will restore the array.

     

  6. The query I posted most probably wont work. I only posted an example SQL Query of how to query multiple tables using joins.

     

    You cannot define (PHP) variables within SQL code. You first need to run the query using mysql_query and then retrieve the results using one of the mysql_fetch_* functions (eg mysql_fetch_assoc).

     

    I rewrote your code, does this seem logical?

    No. Because that is invalid MySQL syntax.

     

     

  7. As you're needing to query multiple tables to get the necessary values you'll want to use a JOIN in order query these tables at the same time.

     

    Reading your post I have came up with this untested query.

    SELECT domain.manual_approve
           register.username
    FROM alldomain
    LEFT JOIN domain
        ON (domain.id = alldomain.id)
    LEFT JOIN register
        ON(alldomain.userid = register.id)
    WHERE alldomain.domain = '$link_url'

     

    I don't know how you're linking the records in the domain table with the records within the alldomain table. I have guessed you're using an id field

    LEFT JOIN domain
        ON (domain.id = alldomain.id)

  8. Below that, each "post" will be assigned a number based on the last post made to that page.  So if I was the first one to post it, it'd show "1" in the data.

    if the posts are being saved to mysql database then setup an auto_increment id field. MySQL will then assign each post you add to the database its own unique id number.

     

    it will post their information on the page they selected, organized with the picture a certain size on the left, and the text aligned ragged right on the right side of the picture.

    You'd use HTML/CSS to position the content in the pages. Just use PHP to output the text/image.

  9. By the way you may want to look into using ternary operators (eg:  ( condition )? true : false ). You can recode the if/else statement with just two lines

    				$selected = isset($_POST['industry']) && $industry['industry_id'] == $isset) ? ' selected="selected"' : null;
    			echo "<option value=\"{$industry['industry_id']}\"{$selected}>${industry['industry']}</option>\n";

  10. Because you are reloading the page PHP will not carry over the $last_id variable. In order to send this variable to the next page you need to either include it within your form as a hidden form field. Or set it as a session variable

    $_SESSION['last_id'] = $last_id;

     

    IMPORTANT make sure you call session_start() as the first line in your PHP files that uses sessions.

  11. Are the passwords in your database stored as md5 hashes. Also make sure the password field is set to at lease 32 characters. md5() will return a 32 character hash, if the password field does not store enough characters the query will always fail.

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