ShawnCplus 456 Code Monkey Team Colleague

Well you would have a hidden form field

<input type="hidden" name="SomeName" id="someID" value=""/>

Then you would use javascript to set the value.

document.getElementById('someID').value = "Something here";

Then in PHP you would retrieve that after the page was submitted.

$someName = $_REQUEST['SomeName'];
ShawnCplus 456 Code Monkey Team Colleague

I think he wants to import a javascript variable into PHP. the easiest way would be to write the variable to a hidden form element then retrieve it in REQUEST data.

ShawnCplus 456 Code Monkey Team Colleague

... I'm not entirely sure why'd you write your own function when the built-in addslashes function works perfectly well.

ShawnCplus 456 Code Monkey Team Colleague

Actually it's the other way around :)
pre == before
post == after

Yeah, it was a long day :)

ShawnCplus 456 Code Monkey Team Colleague

printf is your best bet for a cout alternative. It is from the cstdlib library (for C++, stdlib.h for C)

ShawnCplus 456 Code Monkey Team Colleague

You would cast it like this

cout<<"The letter in the middle is " << (char)((c1+c2)/2) << endl;

Your usage of the word alphabet is incorrect however. Alphabet denotes the entire list of letters. The way you use the word is what "letter" means.

ShawnCplus 456 Code Monkey Team Colleague

Well you have two options: You can use iframes or you can have every poem in the same page but in separate divs. The divs will have different IDs and then you would use javascript to manipulate their style to hide and show them. ie.,

<style type="text/css">
[id^="poem"]{display: none;}
</style>

<script style="text/javascript">
function switchVis(obj){
      var el = document.getElementById(obj);
      if ( el.style.display != 'none' ) 
              el.style.display = 'none';
      else  el.style.display = '';
}
</script>
... in the body

<div id="poem1">This is a poem, etc.</div>
<div id="poem2">This is a poem, etc.</div>

<a onclick="switchVis('poem1');>See Poem 1</a>
ShawnCplus 456 Code Monkey Team Colleague

Because in HTML whitespace characters (newline, space, tab) are ignored with rendering the page.

ShawnCplus 456 Code Monkey Team Colleague

Well the \n isn't parsed for single quotes but it is for double quotes. Also, I'm not sure where you're trying to use it but if you are just outputting to an HTML page then it wont display the newline because whitespace characters(unless preempted with a <pre>) tag are ignored. You can use the nltobr(string) function to convert them however

ShawnCplus 456 Code Monkey Team Colleague

It's not a script, it's just an iframe. For future reference try to spell out your words, that was incredibly confusing.

ShawnCplus 456 Code Monkey Team Colleague

I already answered your question, you must use frames. Though you though that Runescape wasn't using frames they are.

ShawnCplus 456 Code Monkey Team Colleague

The section you're looking for is Job Offers in the IT Water Cooler forums up at the top there

ShawnCplus 456 Code Monkey Team Colleague

Ezzaral gave quite a nice example. x++ is known as a prefix increment and ++x is a postfix increment. Most commonly you will use a prefix increment (loops and such) ie., for(int i=0;i < 10;i++)

ShawnCplus 456 Code Monkey Team Colleague

Just to see what happens set try and set the z-index of the div to something high, the div might be actually disappearing behind the table.

ShawnCplus 456 Code Monkey Team Colleague

heh, just noticed that. Don't have an anchor on a button, just use the onclick attribute of the button.

ShawnCplus 456 Code Monkey Team Colleague

The only thing I could think of is that the href isn't the first thing but for some reason I think that's a longshot. It's worth a shot nonetheless. I'm not, however, familiar with that webbot stuff

ShawnCplus 456 Code Monkey Team Colleague

Well considering you haven't shown us any of the code or a link to the page it's a bit like diagnosing a patient that hasn't told you any symptoms.

ShawnCplus 456 Code Monkey Team Colleague

The simplest way is to have that content section an iframe then to load that you would set the link's target attribute to the id of the iframe ie.,

<a href="test.html" target="MyIFrame">Open this in the content</a>
ShawnCplus 456 Code Monkey Team Colleague

Well wrapping a td in a div is sort of like mixing sugar and salt. Table cells are used because their alignment and size will be uniform to the surrounding cells, divs are used for general content positioning, which may or may not be uniform.

ShawnCplus 456 Code Monkey Team Colleague

Just a wild guess here but I'd say you haven't seen any of the giant text on every forum that says we don't give homework help to people that don't make an attempt. Please show us some code and we'll help you with what you need to improve upon and any errors that pop up. We aren't hired homework help.

ShawnCplus 456 Code Monkey Team Colleague

I can help by suggesting that you not revive year and a half old threads, please create a new one and let this one die

ShawnCplus 456 Code Monkey Team Colleague
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <string>


using namespace std;

int main()

{
        srand ((unsigned) time(0) ); //<----Only seed once	
//A string is not necessary, you aren't using any the facilities of the class
        char* RandNum;
//What is this supposed to do? There's no input from the user?	
        char UserLetter; // what the user will enter  and the place of storage in char


	for (int i=0; i <10; i++)	
	     RandNum[i] = 65 + rand()% 26;

	cout << RandNum << endl;
	return 0;
}

There is no need to cast a string to a char* anyway since cout already knows what a string is and can output it just fine

ShawnCplus 456 Code Monkey Team Colleague

Unfortunately this debate will be rendered moot with the release of IE8 and Firefox 3 since both pass the Acid test with flying colors. I know, Microsoft following standards? *gasp*
And although Firefox currently is easier to develop for CSS, IE is much better with Javascript and AJAX (since AJAX is their technology)

ShawnCplus 456 Code Monkey Team Colleague

Sorry buddy but they do use frames.

ShawnCplus 456 Code Monkey Team Colleague

I'm not sure how it even remotely allowed you to have spaces and quotes in a field name since it would break a query required to make it. Do a little research on database design.

Mainly, research what normalization is.

ShawnCplus 456 Code Monkey Team Colleague

OK then you just answered your own question, go look up how to use frames. w3schools.com is a good resource.

ShawnCplus 456 Code Monkey Team Colleague

You can't really do that unless you use a frame and links on the page would open in the frame instead of their own separate page. Also, try not to
use


three

returns


after

every

few


words

It's annoying.

ShawnCplus 456 Code Monkey Team Colleague
$first = $row->First Name;
$last = $row->Last Name;
$femail = $row->Father's Email;
$r_state = $row->Return State/Zip;

umm. No, though PHP is nice it doesn't speak english. No spaces in variable names, you can't use the descriptions and definitely no quotes in them.
You have to use the field names so if the name for the First Name field was fname then you'd do $row->fname

$r_state = $row->Return State/Zip;

... what is that supposed to do? I'm going to guess you want it to give you something like "New York/15555" but that's not how return works.
You'd have to do something like

$r_state = $row->state . "/" . $row->zip;

It gave you the T_STRING error because when you used that quote for Father's Email it thought you were starting a string.

ShawnCplus 456 Code Monkey Team Colleague

Because it is case sensitive, public is a keyword, Public could be a class or anything really.

ShawnCplus 456 Code Monkey Team Colleague

Just as an example this would stop a submit button from submitting.

<input type="submit" onclick="return confirm("Are You Sure?");" />

If they accept then it continues, if they cancel nothing happens.

ShawnCplus 456 Code Monkey Team Colleague

Well given that you're only pulling data from one table adding the table name in front of each field is unnecessary. Just try SELECT * FROM score_detail WHERE candidate_id = '$GETURLCAND_ID' and set_nbr = '$GETURLSET_NBR' Also, as a little heads up. You aren't cleaning your get data in the least. If the data in question will interact directly with the database in any way you should either sanitize it or send it as POST.

ShawnCplus 456 Code Monkey Team Colleague

Most MUDs do it by binding a port so whenever someone connects to the port it returns the who list like http://www.example.com:4545 I've seen in done with SMAUG codebases so searching the snippets on the SmaugFUSS or AFKMud repositories will most likely turn up results or guides.

ShawnCplus 456 Code Monkey Team Colleague

It doesn't work because you don't need to surround the link with script tags for that inline javascript to work. The <a href="http://www.yahoo.com" onClick="alert('popup');">click this link</a> will work just fine on its own.

ShawnCplus 456 Code Monkey Team Colleague

conio.h works fine for me in Borland DevC++

I think you mean Bloodshed Dev-C++, anyway, I'd have to agree with AD and Narue. Everything I've ever learned has guided me away from conio.h.

ShawnCplus 456 Code Monkey Team Colleague

heh, forgot about that. But to use the functions just do

coutc(red, "How's everyone doing?", true);
coutc(green, 5000, false);

That will display
How are you doing?
5000

ShawnCplus 456 Code Monkey Team Colleague

Just double click any empty gray space on the task manager and it will toggle the display.

ShawnCplus 456 Code Monkey Team Colleague

This is a quick and dirty implementation of the Microsoft API to change console color

enum Colors { 
blue=1, green, cyan, red, purple, yellow, grey, dgrey,
hblue, hgreen, hcyan, hred, hpurple, hyellow, hwhite }

void set_tcolor(short int a)
{
     HANDLE handle = GetStdHandle( STD_OUTPUT_HANDLE ); // Make a handle
     SetConsoleTextAttribute( handle, a ); // Set the color of the text
}
void coutc(int color, char* output, bool newline)
{
     set_tcolor(color);
     cout<< output;
     if(newline) cout << endl;
     set_tcolor(grey);
}
void coutc(int color, int output, bool newline)
{
     set_tcolor(color);
     cout<< output;
     if(newline) cout << endl;
     set_tcolor(grey);
}
ShawnCplus 456 Code Monkey Team Colleague
$purl = $resultat->product_thumb_image;
echo "<img src='test/image/products/".$purl.".jpg'/>";

Firstly you don't need disambiguation parenthesis when there's no ambiguity. Secondly look at the source of the page that is displayed on and see what is actually output. If it just says <img src='test/image/products/.jpg'/> then $purl isn't being set.

ShawnCplus 456 Code Monkey Team Colleague

its a joke right?

Nope, people that use void main are doomed to be forsaken by the appropriate deity, if the case arises that they do not believe in one then they will be forced to watch nothing but reruns of Who's the boss for the rest of eternity.

ShawnCplus 456 Code Monkey Team Colleague

He was referring to Salem's avatar which states that void main'ers are doomed. void main() , main should always return an int ie., int main()

ShawnCplus 456 Code Monkey Team Colleague

Well the javascript would be something along the lines of

var newElement = document.createElement('option');
newElement.text = <name variable here>;
newElement.id = <id variable here>;
newElement.value = <whatever else here>;
var targetSelect = getElementById('whatever the select id is');
try{targetSelect.add(newElement,null);}catch(ex){targetSelect.add(newElement);}

That creates a new element then adds it as a child element to the select box. The try/catch is there because IE doesn't conform to standards.

ShawnCplus 456 Code Monkey Team Colleague

You can't use C or C++ to create a web application. You need a server side scripting language for a web application (or a dynamic web page, Eg, registration form, login form, etc). php, asp, jsp, asp.net etc are some server side scripting languages. If your site is static, which has no user interaction, then start it by using html.

Learning php is very easy. You can start right away here. To work with php, you need apache, mysql and ofcourse php, which are all free. You can download a combined pack [php, mysql,apache] here. Just download and install. Check w3schools and start learning!
Cheers,
Nav

Actually you can, many CGI modules support compiled languages like C++ and C

How to check is my site static (i have static ip is that it) ?

By static he means the content wont change based on who looks at it or other factors

ShawnCplus 456 Code Monkey Team Colleague

Well if they are logged in as a user just store it in session data, the ID of that user at least so you can check when you display the content what the user level is in the database, like SELECT level FROM user WHERE userID = $_SESSION['userID'] Something along those lines

ShawnCplus 456 Code Monkey Team Colleague

Please stop the madness!
Replace all of this

$mnation2=$row["mnation2"];
$midnodate=$row["midnodate"];
$midplace=$row["midplace"];
$mbirtharabic=$row["mbirtharabic"];
$mbirthplace=$row["mbirthplace"];
$mcheq=$row["mcheq"];
$medu=$row["medu"];
$mname=$row["mname"];
$mstep=$row["mstep"];
$mmarital=$row["mmarital"];
$msex=$row["msex"];
$mgsm=$row["mgsm"];
$uid=$row["uid"];
$msale=$row["msale"];
$mtype=$row["mtype"];
$amm=$row["amm"];
$tott=$row["tott"];
$mlogin=$row["mlogin"];
$mtitle=$row["mtitle"];
$mfirst=$row["mfirst"];
$mmiddle=$row["mmiddle"];
$mlast=$row["mlast"];
$mrefer=$row["mrefer"];
$memail=$row["memail"];
$mphone=$row["mphone"];
$mstreet=$row["mstreet"];
$mcity=$row["mcity"];
$mcountry=$row["mcountry"];
$mnation=$row["mnation"];
$mbranch=$row["mbranch"];
$mdate=$row["mdate"];
$mend=$row["mend"];
$mbank=$row["mbank"];
$mip=$row["mip"];
$domain=$row["domain"];
$domainx=$row["domainx"];
$mbirth=$row["mbirth"];

with this extract($row); . Easier, no?

ShawnCplus 456 Code Monkey Team Colleague

int main1() should be int main() but as the poster above me stated that particular include file is not necessary. Also, #include "iostream" should be #include <iostream> Quotes are generally used to reference headers that require an absolute path or headers in your project.

ShawnCplus 456 Code Monkey Team Colleague

So Firefox 3.0b2 was released and though I'm constantly cringing since my add-ons obviously don't work yet I must say I am very pleased. There is a noticeable difference in the amount of memory being used, I've been using it all day long and I have yet to see it break 70MB.

There are some new features like the site info button (clicking on the favicon of the site) which compiles all of the information like how many times you've visited the site, if there are any cookies or any saved passwords and allowing you to access the controls right from there.
Additionally, there are separate tabs for RSS feeds on the site and site-specific permissions.

Though the download manager has been updated with a search box my much loved "Clean Up" button has gone by the wayside. The ability to restore your session in case of an accident has been overhauled and now you have the option to save your session any time you close the window (which like most other features can be toggled).

Bookmarks, now made a bit easier with a star icon right in the address bar, are ever more easily organized with tagging. Also, as stated in the release notes, there is an added feature for protocol handling so you can personally customize actions like mailto: (though I have not been able to find this much anticipated feature)

There are a lot more features but those are some of the …

ShawnCplus 456 Code Monkey Team Colleague

Well for the one in code tags it has a newline at the start, the second has a newline at the start and another after it, and the third only sends it at the end.

ShawnCplus 456 Code Monkey Team Colleague

\n creates a new line whenever that is used so

cout<<"Hello\nWorld!";
would output
Hello
World!
ShawnCplus 456 Code Monkey Team Colleague

Here is a decent Drupal book http://www.amazon.com/Pro-Drupal-Development-John-VanDyk/dp/1590597559 however, you might want to pick up an introductory PHP book such as this http://www.amazon.com/Programming-PHP-Rasmus-Lerdorf/dp/0596006810/ref=pd_bbs_sr_2?ie=UTF8&s=books&qid=1198104311&sr=1-2 As for the second book I love O'Reilly published books they are generally extremely easy to understand while still being very comprehensive.

ShawnCplus 456 Code Monkey Team Colleague

PHP has quite a few built in sort functions like sort, natsort, asort, etc. See http://us.php.net/manual/en/function.sort.php