Jump to content

john_jack

Members
  • Posts

    77
  • Joined

  • Last visited

Posts posted by john_jack

  1. var userdata = "firstname="+fn+"&lastname="+ln+"$email="+e+"&phone="+p+"&message="+m;
    

    the name you need to use on php side is $_post["firstname"] instead of $_post["first"].

  2. if the image is still not showing up but other info like the adress and such is showing , maybe the problem is in the image path in your database .

    -check if the car directory exists

    -make sure that the images you are trying to display are in car directory

    -check the images paths in your database .

     

    PS open the developer tools on your browser and check the path in the <img> tag

  3. First of all take a look here http://www.w3schools.com/jquery/jquery_selectors.asp

     

    i tried this and it works .

    <html>
    <head>
    <style>
    .nav{
        display: block;
        width: 10%;  
        float: left;
        margin-left: 6.25%;
        margin-top:-10px;
        opacity: 0;
    }
    .vis{
        opacity: 1;
    }
    
    </style>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    </head>
    <div style="width:100%">
    <img src="skit/images/example/002.jpg" class="nav" id="img1"/>
    <br />
    
    </div>
    <div id="of"></div>
    
    <script>
    jQuery(document).ready(function () {
       
        var navOffset = jQuery("#of").offset().top;
         
        jQuery(window).scroll(function () {
            var scrollPos = jQuery(window).scrollTop();
           //alert(scrollPos);
    	   $("#of").html("nav :" + navOffset +"scroll :"+scrollPos);
            if (scrollPos >= navOffset) {
                jQuery("#img1").addClass("vis");
    			jQuery("#img1").removeClass("nav");
            } else {
                jQuery("#img1").removeClass("vis");
    			jQuery("#img1").addClass("nav");
            }
        });
       
       
    });
    </script>
    okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok</br>okok
    
  4. here is an eg :

    <img src="./01.png" id='img1'/>
    <img src="./02.png" id='img2'/>
    <script>
    
    var x=1;
            var myVar = setInterval(myTimer, 1000);
    
    function myTimer() {
       if(x%2==0){
    	document.getElementById("img1").style.display = "none";
    	document.getElementById("img2").style.display = "block";
            x=1;
    		}
    	else{
    	     document.getElementById("img2").style.display = "none";
    	document.getElementById("img1").style.display = "block";
    	x=2;
    	}	
    }
    </script>
    

    all you have to do is get some images and set the SRC path to the right location .

  5. i suppose you are typing html in the the text fileds :

    $title=$_POST['title'];
    $body=$_POST['body'];
    use this instead to avoid errors even thoe you didnt mention an error !
    $title=addslashes($_POST['title']);
    $body=addslashes($_POST['body']);
    as for the large size post problem try one of these 2 solutions

    1) go to php.ini

    post_max_size=20M
    upload_max_filesize=20M

     

    2) use an .htaccess / httpd.conf / virtualhost include

    php_value post_max_size 20M
    php_value upload_max_filesize 20M
    • Like 1
  6. you need to put the " Echo" part inside the while loop .

     

     

    <?php

    $con=new mysqli("localhost","root","", "testdb");
    $sql="SELECT * FROM cms";
    $run=mysqli_query($con, $sql);
    while($row=mysqli_fetch_array($run)) {
    $title=$row['title'];
    $body=$row['body'];
    }
    echo "
    <h1> $title</h1
    <p>$body</p>
    ";
    ?>

    replace it with this :

    <?php 
    $con=new mysqli("localhost","root","", "testdb");
    $sql="SELECT * FROM cms";
     
    $run=mysqli_query($con, $sql);
    while($row=mysqli_fetch_array($run)) {
    $title=$row['title'];
    $body=$row['body'];
    echo "
    <h1> $title</h1
    <p>$body</p>
     
    ";
    
    }
    
    
    ?>
    
    • Like 1
  7. here is a simple code to help you understand .

    Unit price :<input type="text" id="unit_price" /><br />
    Quantity :<input type="text" id="quantity" /><br />
    <button id="b_total" onclick="calculate();">calculate</button><div id="result"></div>
    <script>
    function calculate()
    {
    var price_unit=document.getElementById("unit_price").value;
    var quantity=document.getElementById("quantity").value;
    document.getElementById("result").innerHTML = quantity * price_unit +" $";
    }
    </script> 

    all you need is set your own values (if you are retriving data via Php from a database or whatever) + calculate the tax and you ae good to go

  8. for the signup :

    usualy theres a basic html form that sends the data to a server side script Php for eg.the php file checks the validity of the data sent via the form if everything is ok you insert the data in a database for eg "a table called user" via SQL query .

     

    check this http://www.w3schools.com/Php/php_forms.asp

     

    for the sign in :

     

    a basic html for login and password once submited transmits the data to a php file that checks if the user is registred in the database if its ok you redirect him to a page of your choice . you will have to use sessions http://www.w3schools.com/php/php_sessions.asp to keep track of the user and what he can access or not

  9. not sure what you are saying but "="

     

     

    The basic assignment operator is "=". Your first inclination might be to think of this as "equal to". Don't. It really means that the left operand gets set to the value of the expression on the right (that is, "gets set to"). http://php.net/manual/en/language.operators.assignment.php

     

    and i tried this code :

    <?php 
    $a=1;
    $b=2;
    $c=3;
    $d=4;
    $a+$b=$c+$d;
    echo"a = $a b= $b c= $c d= $d";
    ?>
    

    the result was a = 1 b= 7 c= 3 d= 4 .

     

    as you can see the $a stayed the same no value assigned to it after the $a+$b=$c+$d; only $b gets a new value .

    hope this explains it

  10. i folowed the tutorial as it was at first but didnt work ,didnt create the database .so i though maybe if i created it it will resolve the issue but sadly no .

     

    i used the sql provided in create_customer.js to create the table .

     

    when i use a php file to retrive data and make the result as json it works .

     

     

    i know these kinda tutorials are usualy to be 100% working ,but idk man ! thats why i asked if theres a way to get more details about the error somehow :s

     

    anything else i can provide you that might help?

×
×
  • Create New...