Hi Guys I wrote simple PHP script for get value from URL and check similar values from the database. This is a code <?php include('../../datab.php'); if(!empty($_GET['ip'])) { $ip = $_GET['ip']; $ipcheck = mysql_query("SELECT * FROM `report` WHERE `ip`='$ip'"); if(mysql_num_rows($ipcheck)> 0) { while($row = mysql_fetch_array($ipcheck)){ ?> <body> <p>Report ID : <?php echo $row['id'] ?></p> <?php } else { echo "Nothing Selected"; } }} ?> </body> But Dreamviewer shows there is a error in `else`part after the <p>Report ID : <?php echo $row['id'] ?></p> <?php } lines, (see attachment 01) Whats wrong with my code?

Member Avatar
Member Avatar
+0 forum 9

Hi Guys, I am developing a Music Database system. This is a 'Song.php' page. It will be a Detailed page of a each song. Ex : song.php?id=1 <?php if(!empty($_GET['id'])) { $sid = mysql_real_escape_string ($_GET['id']); } // if song id is null, user will redirect to the full song list else header ("Location: songlist.php"); ?> <?php // including database connection include ('datab.php'); $songs = mysql_query("SELECT * FROM `songs` WHERE `id`='$sid'")or die(mysql_error()); if(mysql_num_rows($songs)> 0) { while($row = mysql_fetch_array($songs)){ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php echo $row['name']; ?> - Music Onz</title> …

Member Avatar
Member Avatar
+0 forum 6

This is the project I need to finish. I am fairly new to php and this project has got me confused. Any help would be greatly appreciated The project ask for to validate ISBN 10 Number. There would be 10 digits with 1-9 being Numbers, but Number 10 is an x. This is What I have so far: This is the input page or html page: <form method="POST" action="Process10ISBN.php"> <p>Enter ISBN 10: <input type="text" name="isbn10" /></p> <input type="submit" name="Submit" value="Submit" /> </form> This is what I have so far for the Procssing page to validate ISBN 10: if (empty($_POST['isbn10'])) echo …

Member Avatar
Member Avatar
+0 forum 6

The following code is producing this error `Microsoft VBScript compilation error 800a03f6 Expected End ` followed by `/stock/availability-quick/availability2.asp, line 130` I think it is a if else error. I have looked over the code and i don't see the error and would benefit from an expert pair of eyes to look over it. Thanks in advance David <%@LANGUAGE="VBSCRIPT"%> <!--#include file="../../includes/functions/insphire.asp"--> <!--#include file="../../includes/functions/logaccess.asp"--> <!--#include file="../../includes/functions/stock.asp"--> <% if request("Allow") = "f875eba08594178509bd3482dc0294" then ' security check passed %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Administration - Stock - Status</title> </head> <body> …

Member Avatar
+0 forum 0

So everything works right now, but I need that final section (will be turned into a function later) to display the number of A's, B's, C's, D's, and F's. It seems like it should be pretty simple, but nothing is working for me. Thanks! #include <iostream> using std::cout; using std::cin; using std::endl; int main() { int scores[10], average = 0, grade [10]; double score = 0; for ( int i = 0; i < 10; i++ ) { cout << "Enter Student #" << i + 1 << "'s score: "; cin >> scores[i]; score = scores[i]; if ( score …

Member Avatar
Member Avatar
+0 forum 1

For the if discriminant < 0 statement, I need to not only display the error message, but I must display the complex roots in the correct format for complex numbers. How should I go about that? #include <iostream> #include <cmath> using std::cout; using std::cin; int main() { int a = 0, b = 0, c = 0, x1 = 0, x2 = 0, discriminant = 0; cout <<"Enter value for A: "; cin >> a; cout <<"Enter value for B: "; cin >> b; cout <<"Enter value for C: "; cin >> c; x1 = (-b + sqrt ((b * …

Member Avatar
Member Avatar
+0 forum 2

class Timerange{ public: Start_time start; End_time end; Timerange(string initstring){ //initstring xx:xx X, x:x //X->weekday string current=""; unsigned short mode=0; string timeA; string weekday; string timeB; for(unsigned short i = 0; i<initstring.length(); i++) { char c = initstring[i]; if (c==' '){ if (mode==0) timeA = current; else if (mode==1) weekday = current; else if (mode==2) timeB = current; mode++; current =""; }; else{ //here current+=c; }; }; }; }; it gives me error: 'else' without previous 'if'' but there is an if! What's going on?

Member Avatar
Member Avatar
+0 forum 1

i wantto builda GPA in C# and want to a condtion which chek the value from user input. chek it if it is greater then 70 show A GRADE greater then 50 show B GRADE like and print it and also set is this char type value to switch and calculate the piont like /* switch(GRADE) { case 'A': points = hours * 4; break; case 'B': points = hours * 3; break; } Consol.WriteLine(GRADE); Consol.WriteLine(GPA); */this just an idea

Member Avatar
Member Avatar
+0 forum 3

Hello! I'm having a rather difficult time because the concepts weren't very much explained in class for complex situations. I'm a bit entangled with the few if-else conditions I have... :( I've been trying hard to crack the case, but I think somebody really needs to see my work. Write a menu driven program for the following options using ladderized if-else statement: a. To find whether the number is odd or even. b. To display sum of input five numbers. c. Exit.

Member Avatar
Member Avatar
+0 forum 4

I'm trying to create a game of Go Fish in Python. But I've stumbled onto a little problem that I can't seem to figure out how to deal with. There is a human player (player 0) and three computer players (from 1-3). The human player goes first and chooses a target player. And then a card rank (for example, the player could target player two and choose jacks, then the computer would have to give the player all its jacks). What I have so far is below but the problem I'm having is right at the bottom of the code. …

Member Avatar
Member Avatar
+0 forum 3

So here is what I want. if (tracks, the db) (user_id, the row) for '".$_SESSION['user']['id']."' = equal (tracks, row) in (users, the db) for '".$_SESSION['user']['id']."' exit else update (users, the db) (tracks, the row) to match. This isn't the script as I don't know where to start but I am looking on how to do this to no anvil, another solution is when my insert script is done and is successful then update another table in the db but I also wouldn't know where to start that :/ any help greatly appreciated!

Member Avatar
Member Avatar
+0 forum 1

What's the difference and which are you supposed to use? I typically stick to `else if` unless I am using short tags. Is this correct??

Member Avatar
Member Avatar
+0 forum 17

!! i was trying to create a simple grading system but my project doesnt work it always shows the last if statement and ignore the other statement...please help here's my code...can someone please tell me what's wrong coz i dont know how to use if/elseif/else statement... newbie here...please help Private Sub Command1_Click() Text6.Text = Val(Text2.Text) * 0.1 Text7.Text = Val(Text3.Text) * 0.2 Text8.Text = Val(Text4.Text) * 0.3 Text9.Text = Val(Text5.Text) * 0.4 Text10.Text = Val(Text6.Text) + Val(Text7.Text) + Val(Text8.Text) + Val(Text9.Text) If Val(Text10.Text) <= 100 Or Val(Text10.Text) >= 97 Then Text11.Text = 1 End If If Val(Text10.Text) <= 96 Or …

Member Avatar
Member Avatar
+0 forum 3

Hello all, I'm fairly new to using PHP, and for my assignment I've coded it all but I'm trying to go the extra step, and code something that if the item amount = 0 it doesn't print it out on the order form The items are $LAPTOP $MONITOR $KEYBOARD $PRINTER I'm trying to figure out how to get it that if one of them or all of them or a few of them are equal to 0, how can I get it to not print them on the order form I tried using if and else if and && but …

Member Avatar
Member Avatar
+0 forum 12

This code works fine but it would be too long if the score is 50 or over. Is there any way to make it shorter and quicker? I tried to use for loop statement but it didn't work well. background(backgroundChange); if (score >= 5 && score < 10) backgroundChange-=0.8; else if (score >= 10 && score < 15) backgroundChange+=0.8; else if (score >= 15 && score < 20) backgroundChange-=0.8;

Member Avatar
Member Avatar
+0 forum 3

**Does the code** int value = 5; if(value==5) System.out.println("value is 5"); if(value==6) System.out.println("value is 6"); **actually compute faster than** int value = 5; if(value==5) System.out.println("value is 5"); else if(value==6) System.out.println("value is 6"); **?** I would assume that it *is* faster, based on its name and all, but is that actually how it works? When translated to machine code, does it run faster? If I had thousands of lines of code, would a program using "else if" run faster than one using only "if" statements? If so, by how much? PS: I'm using Java but I think this applies to all …

Member Avatar
Member Avatar
+0 forum 14

So in my classes I've taken I was told by the teacher "case statements and if-else statements are the same things essentionally" so why learn both? and so I was not taught about cases. Besides the fact I should learn it anyway incase I need it for someone elses code, should I learn these for an actual purpose? Are they good for something that if-else isnt as good for?

Member Avatar
Member Avatar
+0 forum 3

Hi, recently i started taking lessons on c programming and my first assignment was to make programm which would name all the perfect multiperfect or superperfect numbers within a set (whose limits will be given as #define constants) and their percentage. Anyway apart from any logic errors (which i would be very glad if someone pointed out!!) i'm facing some compilation difficuties. Specifically the code is #include <stdio.h> #define MAXM 6 #define MAXNUM 400000 main() { int n, sum, i, k, m, totdis, totsup, totmul, total, totper; totdis=0; total=0; totmul=0; totper=0; totsup=0; for (n = 1 ; n <= MAXNUM …

Member Avatar
Member Avatar
+0 forum 4

assuming everything else works...i'm having trouble with the output...the if else statements are driving me crazy. it is outputting the date twice when i enter 7/3/12 code displays todays date....displays "payday" entered......adds 7 days to "payday" to show NEXT payday. void Date::addDays(int month, int day, int year) { _day = _day + 7; if(_day > 30) { _day = _day - 30; _month = _month + 1; } else { cout << _month; cout << "/"; cout << _day; cout << "/"; cout << _year; } if(_month>12) { _month = _month - 12; cout << _month; cout << "/"; cout …

Member Avatar
Member Avatar
+0 forum 1

My assignment is to randomly generate a password based on the selection chosen by the user. So far, my code is unfinished but that's because I've run into a problem. For the second selection(Lowercase and uppercase letters). My password will display lowercase and uppercase letters but it won't be enough letters (I also prompt the user to type in how long they want their password to be). For example, if the person wants a password with a length of 14 and lowercase and uppercase letters, I'll only get a password that's less than that. It's never the length that it's …

Member Avatar
Member Avatar
+0 forum 3

// #include <iostream> #include <iomanip> using namespace std; int main() { float assign1, assign2, assign3, assign4, examScore; float assignWeight; cout << " Welcome to UOW Score System" << endl; cout << " " << endl; cout << "Enter the scores for Assignment 1 / 2 / 3 / 4" << endl; cout << "==> " << endl; cin >> assign1 >> assign2 >> assign3 >> assign4; cin.clear (); cin.ignore (100, '\n'); cout << "Enter the weight for each assignment" << endl; cout << "==> " << endl; cin >> assignWeight; cin.clear (); cin.ignore (100, '\n'); cout << "Enter the score …

Member Avatar
Member Avatar
+0 forum 1

hi, i'm working with php short hand for the first time and i'm trying to edit this code: <?=($c->is_admin == 'Yes')?'<a href="msg_update.php" input type="submit" class="button" value="protected page">Update Home Page Message</a>' : ' <p> This is not the page you were looking for. </p> ' ?> i want to do something like this : <?=($c->is_admin == 'Yes')?'<a href="msg_update.php" input type="submit" class="button" value="protected page">Update Home Page Message</a>' $con = @mysql_connect(my login stuff); mysql_select_db(more stuff); // database if (!$con) { echo'connection error'; die('Could not connect: ' . mysql_error()); } : ' <p> This is not the page you were looking for. </p> ' …

Member Avatar
Member Avatar
+0 forum 1

#include <iostream> #include <cmath> #include <string> #include <cstdlib> #include <cstring> using namespace std; int main() { char chouseing_alphabet[27]={'a', 'b', 'c', '\0'}; string abc[27]; cout << "This program encrypts messages using Ceaser Cipher\n"; cout << "NOTE:capital letters are not allowed in this program\n"; cout << "\n---------------------------------------------------------"; cout << "\n---------------------------------------------------------"; cout << "\nEnter plaintext or enter abc to use alphabet as plaintext:\n"; cin >> abc[27]; cout << "\n---------------------------------------------------------"; if ((&chouseing_alphabet[0] == abc[0])||(&chouseing_alphabet[1] == abc[1])||(&chouseing_alphabet[2] == abc[2])) { //custom_alphabet[27]=abc[27]; cout << "\nCustom alphabeth selected as plaintext\n"; //custom_alphabet[27]++; //cout << custom_alphabet[0]++; } else { cout << "\nAlphabet selected as plaintext\n"; //char alphabet[27]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','\0'}; //alphabet[27]++; //cout …

Member Avatar
Member Avatar
+0 forum 9

Hi everyone I'm having a problem with this program giving me the wrong output. The question is • void getScore() should ask the user for a test score, store it in a reference parameter variable. This function should be called by the main once for of the six scores to be entered by the user. • double calcAverage() should calculate and return the average of the five highest scores. This function should be called just once by the main, and should be passed the six scores. • int findLowest() should find and return the lowest of the six scores passed …

Member Avatar
Member Avatar
+0 forum 12

hi all! lame programmer here again.Please explain this thing..seems like it has truth table and stuf.anding oring etc..plz explain how this will execute.need simple explanation so i wont forget throughout my life..:D if (!(mysql_query($sql,$con)) || !(mysql_query($sql_pin,$con))) { if(mysql_errno()==1062) { $error_flag=1; echo mysql_error(); echo "error no:".mysql_errno(); die("error:".mysql_errno()); } $error_flag=1; } else $error_flag=0;

Member Avatar
Member Avatar
+0 forum 4

Whats wrong with this code? I have not any errors from ie. <html> <script type="text/javascript"> var a = 1; var b = 2; if (a < b) { document.write("CONDITION TRUE :D") } else { document.write("CONDITION IS FALSE D:") </script> So?

Member Avatar
Member Avatar
+0 forum 14

I am hoping this is an easy question. I am not well versed in Java, I am a ITSM admin, but the ITSM product we use comes with Tomcat as it's web server. I am trying to find out if there is a simple way to set index file (welcome page) of a tomcat site to check for the requestURL() and redirect to certain URL's based on the requestURL(). Long story short I am trying to setup my site like this: (my tomact server is setup to receive requests on two different hostnames) If end users reaches my page by …

Member Avatar
Member Avatar
+0 forum 1

hello everyone, I am recieving this compiler error stating that `else if(input%100 || input%10 == rndNum%100 || rndNum%10)` this line ^ gives me the error error: bad operand types for binary operator '||' was hoping someone could explain this error to me if possible, also any advice would be greatly appreciated! Thanks!!

Member Avatar
Member Avatar
+0 forum 5

The End.