rotten69 20 Posting Whiz

@peter... I am an iPhone so I would not know if it is supported or not on Android 4.1 and above but I believe you can download an AIR runtime app on Android based device or even package AIR runtime within your newly made app.

rotten69 20 Posting Whiz

You could use ActionScript3 or Flash to create an AIR app which can run on iOS and android platforms without learning Objective-c or Java.

rotten69 20 Posting Whiz

Hmmmm, I don't think I've understood your question right. Are you saying once users have entered valid data then they should receive a success message?

I've given you an example up there and feel free to redirect your users to a particular page within the ELSE statement after the line that has echo "success".

rotten69 20 Posting Whiz

Not that I have tried but it seems possible that you can modify the auto-increment number

Have a look at this website Click Here

Alternatively, you could code the logic manually by increasing the id by one. For example, you're storing a first userID which normally starts as zero then increment it by one and finally store it in your table.

I hope this helps..

rotten69 20 Posting Whiz

if this solves the problem, please mark it as solved.

rotten69 20 Posting Whiz

Hmmm, the question is why do you want to initialize your variables with empty values?

How about trying this?

1- Separate your PHP file just for the sake of understanding what's going on in your scripts and different pages.
2- Putting the name of PHP file in the action attribute in the form. E.g <form action="validation.php" method="POST">

3- Try this:

<?php
    // define variables and initialize with empty values
    $fname = $_POST["fname"];

    $lname = $_POST["lname"];

    $pass = $_POST["pass"];

    $errorMsg= "Missing ";


    if (empty($fname) ) {
       echo $errorMsg + "First name";

    }else if (empty($lname) ){
        echo $errorMsg + "Last name";

    }else if (empty($pass) ) {
        echo $errorMsg + "Password";

    }else{
        echo "Success";
    }
 ?>

Save the above code in a new file called validation.php

rotten69 20 Posting Whiz

How do you mean "my pc skips the boot from cd"?

Press F10 or F5 when you restart the pc and see a black screen asking you a question on the bottom if you want to go to the BIOS screen.

rotten69 20 Posting Whiz

@kamil.metkowski Look, change the data type of the "product_image" to text or varchar whichever you like. It will work the way you've got as <img src="<?php echo $row['image']; ?>" alt="your alt text" /> I don't think you'd have to do encode it to BLOB on the server then decode it on the client side.

rotten69 20 Posting Whiz

I know this question doesn't fit in this thread but it might be primarily helpful to the thread owner since he's using images as well as other people who are interested in knowing that area of knowledge.

thanks.

rotten69 20 Posting Whiz

I was told it's not a good practice to store images in a database because they take lots of space in the database?

What is the best solution to that?

rotten69 20 Posting Whiz

I think you'd go with inheritance to solve the problem. Think of it this way, for example, you're implementing a vehicle and different types of it. You'd have a vehicle class that has the main functionality which is shared by different types such as trucks, cars and so on. In truck and car classes you'd have functions that are just specific to them.

In your example, you'd have the main management industrial tool class which implements functions that will be shared by other classes like electric, hydraulic and mechanic.

in the case of your program catching the error, you'd check for the appropriate errors such as checking the input if it is a number, string or others depending on what the program is expecting. If the program fails in getting the right input, then it throws or deals with the error.

I hope that makes sense and helps you a bit.

rotten69 20 Posting Whiz

What's happenin? you're trying to upload something in a thread. Is that right?

rotten69 20 Posting Whiz

Make sure you add the link to the CSS file. Show us your index page so we know what's exactly going wrong.

rotten69 20 Posting Whiz

You're welcome, a comment in there and pressing the up arrow will do. And if this solves your problem then mark this thread as solved so others can benefit from it.

rotten69 20 Posting Whiz

For operting systems other than windows including Mac OS and Linux, I would go with Monodevelop.

rotten69 20 Posting Whiz

Hmmmmm,If you want to get the avaerage of the inputs that you're getting from your users.
1- Loop through the inputs and store them in one variable by using += operator or variable = variable + array[index] / array.Length.

I reckon you should catch exceptions like FormatException and other ones. your program crashes I enter a string in there.

Try this.

        int input;
        Console.WriteLine("Enter the number of expriments you want to make:");
        input = int.Parse(Console.ReadLine());
        int[] index = new int[input];
        if (input > 2 && input < 6)
        {
            int temp = 0;
            int avg = 0;

            for (int counter = 0; counter < index.Length; counter++)
            {

                Console.WriteLine("Enter number" + counter + ":");
                index[counter] = int.Parse(Console.ReadLine());

                temp += index[counter];
            }

            avg = temp / index.Length;
            Console.WriteLine("Average:" + avg  + "\nwe have :" +temp + " experiments");
        }
        else
        {
            Console.WriteLine("Your input is not valid.");
        }
rotten69 20 Posting Whiz

it is a good idea to use var when declaring variables. E.g var number. The reason being is that your variables will be easy to trace and and it is a good practice.

I guess you're trying to add the value to the textbox you've got there, right?

Try this

 document.divfrm.div.innerHTML=d;
 document.divfrm.div.innerHTML=sp;
rotten69 20 Posting Whiz

I'm happy to do the psudo-code for you as this program is really simple.Although I won't be writing the code. I suggest you write some code following the below steps and once you get stuck, just raise another quetion with the code you've achieved.

make these variables:
1-sum (perhaps global but it doesn't matter in this case)
2-min_num ( it takes in user input)
**3-max_num **(it takes in user input)

then step 4 -> do some checking to see the variables (min_num & max_num) are not empty and contain some values. You'll need to parse them as integers or whatever type you're expecting from your users such as float. It might be a good idea to display a message if users are trying to use your calculator but they aren't entering anything or entering some text which is not acceptable.

5- Use an if-statement to compare min_num < max_num

6- inside your if-statement block.. do your formula. Here where you use the sum to store the result in then return it to users. And if you want to go a little nuts with the result you can say if sum <= 0, then you can return a message to your users saying.. The total is less than or equal to zero.

What is number of integer?

I hope this helps.

rotten69 20 Posting Whiz

The snippet below should solve the problem you had with accessing the array $list [count($value)] which doesn't make sense to me. If you're trying to add the value of count to the array because your previous line stores the number of elements in an array to the index. The way you'd normally do it is $list [] .=count($value) the result you will get is this:
Array ( [0] => 3 [1] => 3 ) However, this won't tell you much about the data stored in the array.

Try this and let us know how you go.

$parent=0;
function getMenu($menu, $parent){

    $list=array();
    foreach ($menu as $key=>$value){

        if($value['parent_id']==$parent){

            $counter = count($value); // count the number of elements in an array
            $list[] = $value;
            echo $counter; 

            echo "<br>";
         }

     }

        return $list;

}

cheers;

rotten69 20 Posting Whiz

Hmmm, Enable the error reporting function so you will be shown if there are any errors.

error_reporting(E_ALL);

You've got the class name as sandwich and construct as operation (change the name of the function to sandwich). In OOP, you need to have the constructor name corresponding to the class name. You may make a function called operation and then it gets called in the constructor.

I hope this helps!

rotten69 20 Posting Whiz

Hmmmm, show us what you've got so we can help you with it.

rotten69 20 Posting Whiz

To answer your question, here is an example. I hope the example I'm giving will help you.

<?php


$name = "Dani";

if($name== "Dani"){
    echo $name;         => this will output Dani
    $name .= " Web";    => this will concatenate the string " Web" to the "Dani"
}

echo $name;    => this will output "Dani Web"


?>
rotten69 20 Posting Whiz

I hear you man it sounds like it's a tough assignment for you. Ok. I will give hints but I ain't too sure how fluently you speak the language (java) or even understand it. For the first program, think about the variables that will store the values you need for the program. E.g purchase price/prices, return on investment..etc. Think about their datatype.

for the second, you'd have an array of strings(if you're asking users for a multiple of strings) or a variable for one string and to do the other things. you'll have to use a method in the string class called substr. Look it up in the documention.

Is the assignment just for fun?

rotten69 20 Posting Whiz

You don't ever use the word OR. Use this symbol || which means or. This symbol && means AND.

if($row['banned'] == 1 or $row['banned']== 2) {

}

What is the message you get when you run your code? Try putting values you're trying to check within single/double qoutes.

rotten69 20 Posting Whiz

I know Java can be sometimes confusing when you're trying to learn something new about it. I think there is a problem with defining the array. However, Have a look the Java Tuturial website which explains one dimension and multi-dimension arrays.The link is here

Scroll down to the section mentioned below.

class MultiDimArrayDemo {
    public static void main(String[] args) {
        String[][] names = {
            {"Mr. ", "Mrs. ", "Ms. "},
            {"Smith", "Jones"}
        };
        // Mr. Smith
        System.out.println(names[0][0] + names[1][0]);
        // Ms. Jones
        System.out.println(names[0][2] + names[1][1]);
    }
}

Just if you post any piece of code next time, PLEASE ensure that you use the Code tags. Therefore, your post will be much easier to follow. Thanks.

rotten69 20 Posting Whiz

True. You've got a lot of money to own a server but at the same time, you need to think about what sorts of problems you will be running into by just having your home server. What if someone tries hacking into the server? Is your server gonna be secure enough? What platform will it run on? These days, a lot of servers are running on Linux operating system. It is great that you can afford one but it is not going to be efficient. To answer your questions, you should be looking at a good PHP framework that gives you a good a feature such MVC which stands for Model View Controler for blog purposes and managing your web app.

To beat FaceBook, you would need to have a good service/product so users will use it constantly.That depends on what your business idea is!

rotten69 20 Posting Whiz

I think for restaurant you'd want static pages and won't be processing orders. so it should cost much. Again, it is dependent on the requirements.For example, how much graphic design you want done and how much coding you want done.

rotten69 20 Posting Whiz

You're welcome. Please mark this thread as solved.

rotten69 20 Posting Whiz

That all solves your problem, then mark the thread as solved to let others it is solved!

rotten69 20 Posting Whiz

Check out these websites http://www.thejavascript.com/ or http://www.javascriptkit.com/
if these aren't much help, ask our brother Google!

rotten69 20 Posting Whiz

Here is what you need. It has the doctype declared and also the document elements declared. IF you take all that and paste into a notepad and save the document as index.html, then try running it in a browser. You will definitely not see anything other than the title for the page which is "title for your page goes here". Adding something like <p> This is a paragraph</p> within the body tags.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

  <head>

   <title>Title for your page goes here</title>

  </head>


  <body>



  </body>

</html>
rotten69 20 Posting Whiz
 do {
     // Output your article HTML
     if($advert) {
     // Output your advert
 }

I don't want to confuse mtho. But I would like to understand this section of code.

OK. It is going to start printing out the first article and then it will check for the boolean value of $advert. Since the value is set to true, it will display an ad and set the value of $advert to false. Won't that happen to the second, third and fourth articles and so on?

rotten69 20 Posting Whiz

What do you exactly mean by "you saw too many types of Java"?

Since you had a good background in programming, Java shouldn't be too hard then. I found this thread helpful if you're looking for some books on Java to read or tutorials to learn from as well. Download the Java SDK and JRE from here then direct the enviroment variable on your pc to where JRE is installed. Lastly, download Eclipse from its website.And, You're ready to go.

rotten69 20 Posting Whiz

Ok. The steps are as follows:
1- Open any text editor and make a file and call page or whatever name .php so this will be page.php

2-Take the snippet below and paste in there.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
   <title> I am checking the values for the options chosen in the form </title>
</head>

<body>


         <form name="myForm" action="check.php" method="POST">

             Choose one of these values: &nbsp; 
                 <input type="submit" name="go" value="Go 1" /> &nbsp;
                 <input type="submit" name="go" value="Go 2" /> 

              <?php echo " <p style='background-color:red; width: 5%;'>" .@$_GET['text'] ."</p> "; ?> 


         </form>


</body>
</html>

3- Make another file and call it this name check.php if you want to change the name of the file, then you will have to change the name in the action attribute as well.

4- Take the snippet below and paste it in there

<?php

    $go = $_POST["go"];


        // here we're checking if there is a value for the variable "go" AND the value equals to "Go 1"

        if( (isset($go)) AND ($go1 == "Go 1") ){    
            header("Location:checking.php?text=Go 1 is on");

        }else if(  (isset($go)) AND ($go1 == "Go 2") ){ 
        // here we're checking if there is a value for the variable "go" AND the value equals to "Go 2"

            header("Location:checking.php?text=Go 2 is on");
        } 
?>

Please mark this thread as solved if your problem is fixed. And also, Don't forget to give me a rep on the …

rotten69 20 Posting Whiz

Sure. That is Easy.

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

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

@ 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

Head to this website and explore the different technologeis that they teach for free

rotten69 20 Posting Whiz

Hmmm, it's quite long to follow. Select the lines you have probs with so we can help you. And if we need to look at the entire code for more info, it's still there.

Cheers,

rotten69 20 Posting Whiz

Try changing the code in your HTML file to

<div class="button">Button</div>

and in your CSS file,

.button{  }

Otherwise, follow what hericles has mentioned above to fix your problem.

rotten69 20 Posting Whiz

Nice example. OK.Now, Would you call the method getInstance inside the constructor so when the constructor gets called then it will give an instance of ConnectionManager class? OR Would you call the method in another class?

And, What do constructors normally do? Checking and validation? and what else?

Thanks.

rotten69 20 Posting Whiz

Salam alikum.. That works. You should run it before you submit your assignment brother.
Your assignment spec is saying that you need to have a method that compares Max and Min values.

Good luck, ya5y

rotten69 20 Posting Whiz

Maybe because you've got the attribute min-height(do you really need this?) Remove it and see what it looks like.

cheers,

rotten69 20 Posting Whiz

It seems like it. He's welcome again to ask questions related to his code or any question.

Thanks.

rotten69 20 Posting Whiz

I meant to say that using $_REQUEST to pass the value to another page will solve the problem.


@simplypixie .. I ain't sure what the guy is really trying to achieve. But, it seems like the problem is solved on his side.

rotten69 20 Posting Whiz

Oh. it's somewhere in his code.. have a closer look.. the line's number is around 20th

rotten69 20 Posting Whiz

I'm lost now. Where is what?