Jump to content

Bounty

Members
  • Posts

    78
  • Joined

  • Last visited

    Never

Posts posted by Bounty

  1. Okay ive had this forum running very well but i missed 6monthly payment and they shut my host down, luckily i have backup with this cool dynamic theme..i hosted new forum with same theme on byethost so u can see what i want...

     

    Anyways what i want to do (with your help :P). In this theme there is included dynamic navigation bar (or menu) witch you can see here,i want to use that menu on the new site im making now..as i looked through smf source code i found that this nav bar is powered from the javascript file named "menu.js" and some more files...so can this scripts be pulled out from smf pages and codes so i can use it on the page of my own???

     

    Sorry for my bad English i hope you understand what i mean with all this :/

    Thanks..

  2. I ment something like this..could i make a string like "$userlist = command for listing" and use it in html anywhere in the code?

     

    I know this is not a table structure but what is it? It looks messed up...

  3. What do you mean import username "directly"? I don't follow what you're asking.

    Well could i make a variable that displays the list and when needed in html code just inserting the variable in the table..

     

    That isn't the table's structure, really. In phpMyAdmin, select the table, the click the "Structure" tab at the top to see the structure.

    Well what is it? I think its data inside the table...if it is than it is weird...

  4. Have no idea how that line got in there...must be my mistake when pasting or something...

    Anyhow..do i need database connection for this?

     

    Wont work with or without the connection :///

     

    This is the code i use now...

    <html>
    <head>
    <title>Members</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <?php
    $server = "localhost";
    $user = "***";
    $pass = "***";
    $db_name = "mysql";
    
    $dbc = mysql_connect($server, $user, $pass);
    
    mysql_select_db( $db_name, $dbc)
    $query = "SELECT `username` FROM `users` WHERE `username` IS NOT NULL";
    $result = mysql_query($query) or die('Query cratered: ' . mysql_error() . '<br />Using query string: ' . $query);
    echo "<table>";
    $count = 1;
    while( $array = mysql_fetch_assoc($result) ) {
         echo "<tr><td>{$count}</td><td>{$array['username']}</td></tr>";
         $count++;
    }
    echo "</table>";
    ?>
    </body>
    </html>

     

    It shows error in this line:

    $query = "SELECT `username` FROM `users` WHERE `username` IS NOT NULL";

    Should i escape quotes or anything..?

     

     

  5. Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\register\memberspage.php on line 10

     

    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\xampp\htdocs\register\memberspage.php on line 10

     

    Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\register\memberspage.php on line 14

    Line 10:

    $result = mysql_query ("SELECT username FROM $tablee WHERE username IS NOT NULL");

     

    Line 14:

    while ($array = mysql_fetch_assoc($result)) {

    haven't changed a thing...the last time i was trying something thats why it was changed i forgot to undo it :P

  6. <html>
    <head>
    <title>Members</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <?php
    $tablee = "users";
    $username = $_POST['username'];
    $result = mysql_query ("SELECT username FROM $tablee WHERE username IS NOT NULL");
    
    echo '<table>';
    $count = 1;
    while ($array = mysql_fetch_assoc($result)) {
         echo ("<tr><td>$count</td><td>$array[username]</td></tr>");
         $count++;
    }
    echo '</table>';
    ?>
    </body>
    </html>
    

  7. I think you missed an '$' at count = 1;

    Btw with this script i get  this error

    Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\register\memberspage.php on line 15

    Line 15 is this:

    while( $array = mysql_fetch_assoc($result) {

     

    ://

    Thanks for the help btw :)

  8. Ok i managed to change the password and now it connects ok...but it wont select sql database,this is the code..idk what is wrong :///

     

    $connection = mysql_connect("localhost", "root", "*password*");
    mysql_select_db("users") or die( "Unable to select database");

     

    Database is called "users"...:/

     

    Thanks u helped me alot :)

  9. Ok i installed the software and it works charming...only problem is in my script line 166 witch says:

    echo <META HTTP-EQUIV=Refresh CONTENT="0; URL=.$url.">
    

    Error:

    syntax error, unexpected '<' in C:\xampp\htdocs\livereg.php on line 166

    Whats the problem?

  10. I would search if i knew what i was looking for or how to name it xDD

    Thanks on answers i will try all of this today so if i get any errors ill post here ;)

     

    Umm i just remembered one...where can i find virtual ftp server,like offline host so i can test all of this...?

  11. Its solved for now...if i have any more difficulties with this ill post them here..thanks for quick answer :))

     

    Another question...

     

    Can you tell me how can i make a page that creates pages...like on youtube.com,every clip has its own page,right? and only 1 page that makes them (the upload one)...or can you at least point me in right direction...a tutorial or anything...

     

    Thanks =)))

  12. Here...this is the original code it wont work too...://

     

    <html>
    <body>
    <?php
    $url = /'http://www.yourdomain.com/accountok.php\'; // Where to redirect 
    //the user after that form has been processed successfully. Now we will 
    //get the values sent by the form: to get a value you can generally access 
    //it with $_POST[\'valuename\'] where valuename is the string you put into 
    //the value of the the field you are accessing
    $user = $_POST[\'username\'];//get username from form
    $pass = $_POST[\'password\'];//get password from form
    $pass2 = $_POST[\'password2\'];//get password2 from form
    $name = $_POST[\'name\'];//get name from form
    $domain = $_POST[\'domain\'];//get domain from form
    $zip = $_POST[\'zip\'];//get zip from form
    $city = $_POST[\'city\'];//get city from form
    $email = $_POST[\'email\'];//get email from form
    $state = $_POST[\'state\'];//get state from form
    $country = $_POST[\'country\'];//get country from form
    $address = $_POST[\'address\'];//get address from form
    $phone = $_POST[\'phone\'];//get phone from form
    
    //now that we have picked all the values we need from the form we can 
    //start checking them one at a time
    
    //PASSWORD VERIFICATION
    if (($pass)!=($pass2)) //if the values stored in the 2 variables are 
    //different we redirect the users to a previously created error page
    {
    header("Location: error-pwverify.php"); //the user will be sent to this page
    Die();
    }
    //EMAIL VERIFICATION
    function CheckMail($email) // this function checks if the email format is ok, 
    //if the chars are allowed, if there are enough chars in the TLD learn more 
    //about eregi function here: http://www.php.net/manual/en/function.eregi.php
    {
    if(eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\.[a-z]{2,4}$",$email)) 
    { 
    	return true;
    }
    else 
    { 
    	return false; 
    }
    }
    if ((empty($email)) || (!CheckMail($email))) //here we check if the email is 
    //empty and if the previous function controls are passed, if there are 
    //errors the user is sent to a previously prepared custom error page
    {
    header("Location: error-email.php"); //the user will be sent to this page
    Die();
    }
    //ZIP CODE VERIFICATION
    function CheckZip($zip) 
    {
    if (eregi("[0-9]", $zip)) //here we check if the ZIP code contains only numbers
    {
    	return true;
    }
    else 
    { 
    	return false; 
    }
    }
    if ((empty($zip)) || (!CheckZip($zip)) || (strlen($zip)!=5))
    //if the ZIP code is empty, the CheckZip function fails or the code length is 
    //different from 5 chars the user is sent to a previously prepared custom error page
    {
    header("Location: error-zip.php"); //the user will be sent to this page
    Die();
    }
    //NAME VERIFICATION
    //the name and the following fields don\'t allow us to make strict 
    //verifications by the way the user has to have a name so if the name 
    //is empty the user is sent to a previously prepared custom error page
    if (empty($name))
    {
    header("Location: error-name.php"); //the user will be sent to this page
    Die();
    }
    //CITY VERIFICATION
    //exactly the same as the name verification
    if (empty($city))
    {
    header("Location: error-city.php"); //the user will be sent to this page
    Die();
    }
    //STATE/PROVINCE VERIFICATION
    //exactly the same as the name verification
    if (empty($state))
    {
    header("Location: error-state.php"); //the user will be sent to this page
    Die();
    }
    //COUNTRY VERIFICATION
    //exactly the same as the name verification
    if (empty($country))
    {
    header("Location: error-country.php"); //the user will be sent to this page
    Die();
    }
    //ADDRESS VERIFICATION
    //exactly the same as the name verification
    if (empty($address))
    {
    header("Location: error-address.php"); //the user will be sent to this page
    Die();
    }
    //USER AND PASSWORD LENGTH CHECK
    $min_lenngth = 6; //this value is the minimal length that we desire our passwords 
    //to be if the username or the password is shorter than 6 chars the user is sent 
    //to a previously prepared custom error page
    if(strlen($user) < $min_lenngth || strlen($pass) < $min_lenngth)
    {
    header("Location: error-pwshort.php"); //the user will be sent to this page
    Die();
    }
    //NOTE: insert here the code between //****************// and //****************// 
    //in the following part of the tutorial if you want to add these values to your 
    //database
    //NOTE:don\'t use the following code line (erase it) if you inserted here the code 
    //to add the values to the database
    //if all our checks are passed we go to the url assigned at the top to the variable url
    echo <META HTTP-EQUIV=Refresh CONTENT="0; URL=.$url.">;
    ?>
    </body>
    </html>

  13. Heya...i'm getting this strange result when writing php in dreamweaver. When typing <?php tag below <body> it goes red letters and it displays it as an error..even in basic scripts like

     

    <html>
    <body>
    
    <?php
    echo "Hello World";
    ?>
    
    </body>
    </html>

     

    This is the picture of it..

    91204094.jpg

    And when i try to open my html page all html comments (text behind "//") shows on the page..

    Can you tell me what is wrong?

  14. So far xDD

     

    Just another question...i created another text field to be input for a name of the file...the string looks like this:

    $myFile = $_POST['name'];

    And it works but what to use to add .txt to the name of file ? :P

     

    Sorry for bothering :/

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