rotten69 20 Posting Whiz

It Should be "B" .. Good luck.

Mark this thread as solved for others to know it's solved. Cheers!

rotten69 20 Posting Whiz

How do you exactly know if it works perfectly? I have noticed an attribute being left out of the form.

<form method="post">

So, where is the action="" for the page that takes the inputs from users and check them and do the whole PHP magic?

In response to your question whether you should use JavaScript to check the input validation or PHP.I think that depends on you if you want it checked on server side or client side. Client side, of course, is faster.

Let us know how you go. Have a look at these tutorials. I think he got a couple on PHP capcha.

Cheers,

rotten69 20 Posting Whiz

Or you can use this HTML code as well

<input type="hidden" value="" />

I think that is the same as using CSS to hide it.

If this solves your problem, then mark the thread as solved and don't let it be pending.

rotten69 20 Posting Whiz

Can any one help me in generating a webpage using php which should contain a form in a table of 4 columns and more than 50 rows with textboxes

Sure thing. But, please show us what you've done so far and if anything needs any correction, we will help you.

I do appreciate your genuine question. Are you doing this for an assignment or something like that?

rotten69 20 Posting Whiz

Hi everyone,

I'm just looking for some graph makers for the data we have in our database. We would like to analyse the data taken out of the database and present it in a graph format to see who has got low/high ranks.

Is there any free API that we can use? if you know any, please do suggest it with a little mention about how difficult/easy to use it.

That will be so much appreciated.

rotten69 20 Posting Whiz

<table class="form_step2">
<tr class="form_step2">

You may face a few issues if you're coding your CSS file because you've got two COMPLETELY different elements in your HTML file with the same names. Your row is different from your table, isn't it?

I don't see a button in your form. Why is that?

process2.php file

Isn't the above mentioned file getting some data from the other php file to process?

rotten69 20 Posting Whiz

This thread is Fantastic and a lot of useful postings are here. Good Work, guys.

rotten69 20 Posting Whiz

it is kindda hard to look for where the code is breaking and the error you're getting. If you can be a little more specific, then we should be able to help.

Cheers,

rotten69 20 Posting Whiz

I'm sure you're storing the name of your sites in a variable called "page" so echo its value. That is the first solution.

The second solution is to get the URL and break it down and get whatever name appears after "name=" then echo it or optionally, store its value in a variable then echo it.

I hope this helps.

rotten69 20 Posting Whiz

However, the second row is very uneven depending on how much information is in each cell of the first row

How is the second row dependent on the data stored in the first?

Could anyone give me an outline of how I be able to code this?

Definetley. Before we explain anything, we need to understand exactly what you're trying to do. As far as the problem is concerned, you're getting the data from MySQL database and echoing it to your users in a browswer. Is that right? My solution at this stage is to make a static HTML table with all the data you want in it because it is only one small table. Unless, you're trying to do something different.

cheers,

rotten69 20 Posting Whiz
 <script type="text/javascript">
     var sub1 = document.getElementById("input1").value ;
     var sub2 = document.getElementById("input2").value ;
     var sub3 = document.getElementById("input3").value ;
     var sub4 = document.getElementById("input4").value ;

     var GPA = (sub1*1 + sub2*1 + sub3*1 + sub4*1)/4;     **-----> Now, This line doesn't just add the number strings but it adds them up then divide them by 4**

     var para = document.getElementById("para");
     para.innerHTML = GPA;
     //document.writeln(s);
</script>
rotten69 20 Posting Whiz

post your HTML form or code so we can help you

rotten69 20 Posting Whiz

Nah, I don't want to use Jquery. I'd like to keep that code practice produced in javascript..

rotten69 20 Posting Whiz

Hi there,,

I am trying to get my hea around this simple line of code and trying also to make it work. The ball doesn't move to any direction.. thanks for the help..

    <script type="text/javascript">

        function moveRight(){

            document.images['ball'].style.left = parseInt(document.images['ball'].style.left)+5 +"px";

        }
    </script>
</head>
<body>


        <img id="ball" src="ball.jpg" alt="ball bouncing" width="50px" height="50px"/> <br/>

        <input type="button" onclick="javascript: var t = setInterval('moveRight()',  10);"  value="move me">

</body>
rotten69 20 Posting Whiz

Hi everyone,

Would anyone suggest good tutorials on simple game programming in javascript preferably using HTML4 ?

Thank you..

rotten69 20 Posting Whiz

There are a lot of programs that you can use to make websites. If you're aiming at making a number of web pages and would like to organise them, then you may need to look at IDEs such as Eclipse for web development, NetBeans or Komodo. Personally, I have been using Eclipse for php, html and css and a little bit of Javascript then wanted to learn how to use javascript widely. and, I had to download Komodo which has been the best so far for javascript auto-completion. And Eclipse for web development is good for php. Also, if you want something really simple, Try using Notepad++ for free.

If you have any more questions, don't hestitate to ask. And, I hope this helps you.

ndeniche commented: Komodo, where have you been my whole life? +10
rotten69 20 Posting Whiz

This piece of code stops the error message but it doesn't do what I want to do..

 <script type="text/javascript">


     function calculate(){

      var sub1 = document.getElementById("input1").innerHTML;
      var sub2 = document.getElementById("input2").innerHTML;
      var sub3 = document.getElementById("input3").innerHTML ;
      var sub4 = document.getElementById("input4").innerHTML;
      var GPA  = ( (sub1+sub2+sub3+sub4)/4);      -------> the value is ZERO.  What exactly am I doing wrong?
      var para =  document.getElementById("para").innerHTML;


       return para.innerHTML = GPA;


     }



    </script>
</head>
<body>

   <form id="calculator"> 
   Subject 1 : <input type="text" id="input1" value="10" > <br/>
   Subject 2 : <input type="text" id="input2" value="20"> <br/>
   Subject 3 : <input type="text" id="input3" value="30"> <br/>
   Subject 4 : <input type="text" id="input4" value="40"> <br/>
   <p id="para" >  </p>  

   <input type="submit" value="Calculate" onClick="calculate();">

    </form>
</body>
</html>
rotten69 20 Posting Whiz

Thanks for the response and will try what you suggested in a sec and let you know..

rotten69 20 Posting Whiz

I was thinking that way. The only thing that I thought about is sub1 gets the value from input1. But if it doesn't, I can force it to get the value by writing this line

var sub1 = document.getElementById("input1").value;

This still doesn't work and gives the same error message.

rotten69 20 Posting Whiz

Hi there,

Can anyone explain what is wrong with my code? I get an error message saying null value from innerHTML.

    <script type="text/javascript">


      var sub1 = document.getElementById("input1") ;
      var sub2 = document.getElementById("input2") ;
      var sub3 = document.getElementById("input3") ;
      var sub4 = document.getElementById("input4") ;
      var GPA  = (sub1+sub2+sub3+sub4)/4;
      var para =  document.getElementById("para");


       para.innerHTML = GPA;



      //document.writeln(s);

    </script>
</head>
<body>

   <form id="calculator"> 
   Subject 1 : <input type="text" id="input1" value="10" > <br/>
   Subject 2 : <input type="text" id="input2" value="20"> <br/>
   Subject 3 : <input type="text" id="input3" value="30"> <br/>
   Subject 4 : <input type="text" id="input4" value="40"> <br/>
   <input type="text" id="para" >   

   <input type="submit" value="Calculate">

    </form>
</body>
</html>
rotten69 20 Posting Whiz

what's in $strALink? and would you like to add it to the end of the link?

rotten69 20 Posting Whiz

I only want it to have three elements in it. Is there a way of doing that? Or Is javascript flexible and not caring so much like Java?

rotten69 20 Posting Whiz

I got that before but then I was not too sure how to access the value. that is great. Thank you.

How about If I want to loop through, for example, a Math class to see what methods are available in it?

rotten69 20 Posting Whiz

Hi there,

I was wondering what the string.split() does. And another question is that I want to loop through the class like Math and find out what functions are defined in it.But, I was not too sure how to that. I tried a couple of things but they unfortunately didn't work.

Thank you..

rotten69 20 Posting Whiz

Hi there,

I would like to know what the differences between primitive string type and object string type are because I declared both of them and had a look the functions that I can invoke on them. They are the same functions.

Can anyone explain the differences/similarities please?

rotten69 20 Posting Whiz

Hi there,

why does the sort function not sort out numeric values depending on their values(large to small or small to large)?

var drinks1 = [40,30,10,20,100];

println(drinks1.sort());  // this will give you  10, 100, 20, 30, 40

it sorts those values as follows: 10,100,20,30,40

Is there a way of changing the order that the function works in?

rotten69 20 Posting Whiz

Hey there,

Why does the function compact not work for me? it is a function according to the javascript documentation.

The problem is, however; if I add the brackets after it, the browser complains for some reason and it says compact is NOT a function. Also, with the function parseInt, it doesn't take brackets after it. Isn't it a function?

I thought functions should always have brackets inserted after thier names like java and php.

  var drinks = ["pepsi", "coke", "juice", null];

  println(drinks.compact);

Thanks.

rotten69 20 Posting Whiz

Hi there,

I was reading a book on the plane and something interesting came to my mind that needs an answer. The length property of objects is a read/write value. Let's say, you've got an array that has 6 elements in it and you change its length to 10 as shown below.

var array = ["hello", "world", "daniweb"];

alert(array.length);   // this will give you three

array.length = 10;  // Here is the line that changes the value of length

alert(array.length);  // this will give 10

Why would someone change the value of length property?

what is the advantage of doing that?

rotten69 20 Posting Whiz

Hi there,

I was trying different types of array initialisation in Javascript and the book that I was reading, said it is possible to initilaise an array with a speicified number of elements in it. However, I tried it and unfortunately, it didn't work. As you can see the code below, the array b should ONLY have 3 empty elements in it. But, that can add more than 3 elements into it.

             var b = new Array(3);

              //assigning values to the indexes of array b
              for(var i=1; i <= 6; i++){
                  b[i]= i;


                  alert(b.length);
                  println(b[i] + ", ");
              }
rotten69 20 Posting Whiz

How would you like us to help you? I'm sorry to say this, but I don't think anyone of us will have the time to go through what you've produced or someone has produced for you... If you're really after some help with the lines you've posted, then you need to be specific about the issues you're facing with the code. Because we don't know what you're trying to achieve.

Good luck

rotten69 20 Posting Whiz

Hi everyone,

I am trying yo loop through an array property that is multi-valued and so the condition is if that property has what the value specified then alert with a message saying hello.. The other idea is kinda complex that is to check using RegExp...

Here is the code..

         var array = new Array();
         array.fruit= "banana, apple";
         array.vegies ="cucumber, carrot, tomatos, potatos";
         array.drinks = "coke, pepsi";

         var pep = "pepsi";
         var getVal;
         outerloop:
         for(var obj in array){
              getVal = array[obj];
                println(obj + " : " + getVal);

                if ( obj.hasOwnProperty( "pepsi") ){        here is the problem
                     alert("hello");
                     break outerloop;
                }

         }

Cheers,

rotten69 20 Posting Whiz

You can have a look at this snippet from Microsoft website to get an idea of achieving what you want. Check it out

rotten69 20 Posting Whiz

I have never used ? mark in css. What is it supposed to do?

> But if you feel like experimenting a bit, then you can lock the width.
> Replace ? with a numeric value.
> 
>     <body>
>     <div style="width: ?px; height: auto;">
>     --- CONTENT ---
>     </div>
>     </body>
rotten69 20 Posting Whiz

Thanks for the responses. The only trouble I experienced was the menu. I viewed the website on 10 inch screen and it was perfect however, viewing it on 15 inch screen was kinda dodgy. What would happen if I set the width to 100% for the menu and content-div? I wonder if this would overcome problems with autosizing.
what does the property 'auto' do?

rotten69 20 Posting Whiz

Yeah, the problem is with the width. How do I configure it? What is the best solution?

rotten69 20 Posting Whiz

What are you trying to show here? Using a div and giving an Id or class id in order to call it in an external CSS file? So, Applying auto to the props width an height will solve the problem? I will try it in the morning and get back with a def answer.

rotten69 20 Posting Whiz

So, Is that useful to you?

Knowing there are some differences between Google chrome and FireFox. I was testing the method parseInt... Since it is a method, it should have the brakets at the end like so parseInt(). That is why I wanted good reliable JavaScript APIs.

rotten69 20 Posting Whiz

Hi everyone,

I have had this question for a very long time and am not sure about fixing the problems with different screen sizes. Recently, I designed a website on 10 inch screen laptop and when I opened it on the other laptop that is 15 inch screen. I could see the navigation bar elements were very much everywhere. I'd like to know how to fix this problem. I want my website to be viewed as it was designed on all screens.

I am sure there are some people who have got the same query.. If this thread is made sticky in this forum, that be very useful to others, I think.

Cheers,

rotten69 20 Posting Whiz

I know what it is now. I've read about it and it is to do with primitive and object types.
Thanks for the comment.

rotten69 20 Posting Whiz

Hey everyone,

I tried testing this code if it is true or not. But,apparently, it is indeed true. So, it is not like referencing an element in array and changing its value. Can someone explain it why this is exceptional with numbers, please?

var a = 3.14; // Declare and initialize a variable
var b = a; // Copy the variable's value to a new variable
a = 4; // Modify the value of the original variable
alert(b) // Displays 3.14; the copy has not changed

Why is this happening? and it is so different from the code below:

var a = [1,2,3]; // Initialize a variable to refer to an array
var b = a; // Copy that reference into a new variable
a[0] = 99; // Modify the array using the original reference
alert(b); // Display the changed array [99,2,3] using the new reference
rotten69 20 Posting Whiz

Thanks troy. That is a lot of readin, hey? I don't think I can handle that much reading since it is not that useful ..

rotten69 20 Posting Whiz

I don't think he is looking that much security at this stage. But, it is a good intro to SQL injection!

rotten69 20 Posting Whiz

How do you exactly mean? If you're talking about what I am thinking, then you use client-side languages(javascript, jquery)

rotten69 20 Posting Whiz

Try

    $user = $_POST['usname'];
    $pw = $_POST['psname'];

     if (mysql_num_rows($result) >=1)
     {
         setcookie("user", $user , time()+3600);
         echo ("You Have Successfully Logged In</br>");
     }

If this doesn't work, then unset the cookie and do it again. And,let us know how you go!

rotten69 20 Posting Whiz

If you're trying to optimise the search results and make them quicker, you need to build an index on an attribute. You can search through Id's or names in the table you've got by passing an Id. Let's say that you're getting the value of group_id and storing it in a variable called as shown below:

$some_variable= $_GET['group_id'];

"Select search_id, field_value, field_name from TABLE_NAME where group_id = $some_variable" ; 

If you're trying to achieve something in particular, just let us know so we can help you.

rotten69 20 Posting Whiz

@ veedeoo, What editor are you using for php programming? Any good editor for cakephp function autocompletion?

rotten69 20 Posting Whiz

It is kinda hard to read your post. Please use the Code button next to Italic to add the code you want to tell us about. Otherwise, leave your post normal like ours.

Cheers,

rotten69 20 Posting Whiz

The DOM API.

Is there a website so I can access then download a pdf doc?

cheers,

rotten69 20 Posting Whiz

By the way, the right tag for a break is <br />

You have solved your problem, I am assuming?

rotten69 20 Posting Whiz

Try w3schools.com or YouTube the name "php academy"..