Jump to content

Gighalen

Members
  • Posts

    193
  • Joined

  • Last visited

    Never

Posts posted by Gighalen

  1. Youtube would definitely be your best bet. As a rule of thumb, each of your main design elements should be in their own layer, and each layer will translate to it's own div, and may have multiple other divs or other elements contained within that div.

  2. This is debatable, but I generally try to have a fix width of anywhere from 980-1000 with a margin:0px auto; on the wrapping container to center it. I personally don't like using % because if someone happens to be running a tiny resolution it will shoot everything in the foot, where as fixed width forces  the page to be that big so the user with the small resolution would get a scroll bar.

     

    A hybrid approach that you might consider is using something like jQuery to find the width of the window on page load, and then multiply that number by something like .9 (for 90% width) and apply that finished number as the fixed width of your parent wrapper.

  3. #include <iostream>

    #include <iomanip>

    #include <string>

    #include <fstream>

     

    using namespace std;

     

    int main(){

        string inputFile;

        ifstream inFile;

        int count = 0;          // keep track of number of integers read

        int numbers[19];        // array to store our integers

     

        cout << "Enter the name of the data file now: " << endl;

        cin >> inputFile;

            inFile.open(inputFile.c_str());

           

            while(!inFile){

                    cout << "==> Error opening file: " << inputFile << endl;

                    cout << "==> Try Again..." << endl;

                   

                    inFile.clear();

                   

                    cout << fixed << "Enter the name of the data file now: ";

                    cin >> inputFile;

                    cout << inputFile << endl << endl << endl;

           

                    inFile.open(inputFile.c_str());

            }

            while(count <= 19 && inFile >> numbers[count]){

                    cout << numbers[count] << endl;

                    count++;

            }

     

        system("pause");

        return 0;

    }

     

  4. My guess would be that it is because you have it encased in the STRONG tag. Try removing those tags, and applying the font-weight attribute to your styling, like so:

    echo "
       <form name='search' action=".$_SERVER['PHP_SELF']." method='post'> 
            
    <table width='50%' align='center' style='position:relative;center:0px;top:30px;z-index:1>
    
    	<tr> 
              <td colspan='2' style='font-family:verdana;font-size:110%;font-weight:bold;'>Find</td><br></br> 
            </tr> 
            
    	<tr> 
              <td align='right' style='font-family:verdana;font-size:110%;'>Bebe:</td><td><select name='bebe'style='font-size: 18px;'>
    <option value='all'>All</option>
    <option value='Fy'>Fy</option>
    <option value='Kir'>Kir</option>
    </td> 
            </tr> </select>
            <tr> 
              <td align='right' style='font-family:verdana;font-size:110%;'>Om:</td><td><select name='om' style='font-size: 18px;'><option value='all'>All</option>
    <option value='F'>F</option>
    <option value='S'>S</option>
    <option value='j'>J</option></td> 
            </tr> </select>
            <tr> 
              <td align='right' style='font-family:verdana;font-size:110%;'>Pr:</td><td><select name='pr' style='font-size: 18px;'><option value='all'>All</option>
    <option value='ry'>Ry</option>
    <option value='am'>Am</option>
    </td> 
    
    
    
            </tr> </select>
      
              
            </tr> 
            
    	<tr> 
              <td colspan='2' align='center' ><input type='submit' name='submit' style='font-size: 15px;' value='Search!'></td> 
            </tr>  </table></form>
    
    	 <table> <td style='position:absolute;right:18px;top:36px' 'tdimage'  BACKGROUND='for1.jpg' width='290' height='600'></td></tr>
            </table>" ; 

  5. Try adding double quotes around the value attribute.

    <form action='processformmissing.php' method='POST'>
    <fieldset>
    <legend>Choose Department</legend>
    <select name='depart'>
    <option value=''></option>
    
    <?php
    while ($row = mysqli_fetch_array($result))
    	{
    	extract($row);
    	echo "<option value="'.$department.'">$department</option>\n";
    	}
    ?>
    </select>
    <p><input type='submit' value='Select Department' /></p>
    </fieldset>
    
    </form>

  6. You can never be too safe with stripping stuff out of data submitted to a database. I've personally never built an application that handled URLs, but I might suggest  using str_replace to replace all the / in urls with a '-', then use the same str_replace function when you output the data to replace the '-'s with /. I hope that makes sense.

  7. What happens when you use:

     

    <?php
    $db_host = "host";
    $db_usernamen = "username";
    $db_pass = "password"
    $db_name = "database name";
    
    mysql_connect($db_host, $db_username, $db_pass) or die ("couldnot connect to mysql");
    mysql_select_db("db_name") or die ("no database");
    ?>

     

    and

     

    <?php
    require("connect_to_mysql.php");
    
    echo "<h1>success in database connection! happy coding</h1>";
    ?>

     

    ?

  8. I'm not exactly sure how functions will behave if you create one that already exists, but I can tell you that you can create functions in older PHP versions that are used by newer PHP functions to achieve the same result. In example, the realpath_cache_size() function was added in PHP 5 but you can create a function in PHP 4 with that name to create a function that does the same that it would do in PHP 5 - or does something completely different. Hope this helps.

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