1,038 Posted Topics

Member Avatar for AbsoluteCPP

Use [icode]<pre></pre>[/icode] or [icode]<code></code>[/icode] tags around it like: [code=html] <pre> #include &lt;iostream&gt; int main(int argc, char** argv) { std::cout &lt;&lt; "Hello World!\n"; return 0; } </pre>[/code] Note the [icode]&lt;[/icode]. Make sure you encode any HTML entities (<, >, &, etc.) so they don't get mixed in with the markup

Member Avatar for codejoust
0
136
Member Avatar for Graphix

It does save newlines, but my guess is that on output you're not using nl2br. The browser ignores newlines when rendering text unless it is in a <pre>, <code> or tag with white-space:pre applied. So yeah, use nl2br or get a rich-text editor

Member Avatar for ShawnCplus
-1
155
Member Avatar for JayGeePee
Member Avatar for andym67
Member Avatar for ShawnCplus
0
168
Member Avatar for Graphix

[icode]../images/[/icode] The .. means up one directory, so [icode]../images/[/icode] really says [icode]htdocs/mysite/images/[/icode]. It would probably be better to use the absolute path but you haven't posted one so I don't know you're directory structure :)

Member Avatar for Graphix
0
116
Member Avatar for cguan_77

You can get it done with just CSS [code=css] #some_id { position: fixed; }[/code]

Member Avatar for cguan_77
0
92
Member Avatar for armyguydave69

The server it is working on probably has notices turned off. You should have an [icode]if (isset($_POST['username']))[/icode] block around that anyway.

Member Avatar for armyguydave69
0
82
Member Avatar for nish123

[QUOTE=chrishea;999849]How about: [CODE] <?PHP while($row=(mysql_fetch_array(result)) { echo " <td>$row['photo']</td><td>$row['info']</td> "; if ($row=(mysql_fetch_array(result)) { echo " <td>$row['photo']</td><td>$row['info']</td> "; } echo "</tr>"; } ?> [/CODE] I find it messy to go in and out of PHP so I modified it to make it all PHP.[/QUOTE] Just no. For two reasons: Reason 1) …

Member Avatar for CFROG
0
141
Member Avatar for vkennedy

You would setup a server-side script (using PHP or ASP or whatever your language is) that uses cURL or whatever your language uses to make and output the response. Then your AJAX call just points to your script. [code]RemoteServer ------------------- somefile.php MyServer ----------------- myapifile.php `- Make request to RemoteServer.com/somefile.php `- …

Member Avatar for vkennedy
0
117
Member Avatar for feoperro

The example you described isn't AJAX, that's just standard Javascript validation. AJAX would be, for example, as the user types display a list of possible selections underneath the box. [url]http://w3schools.com/ajax/ajax_intro.asp[/url]

Member Avatar for feoperro
0
175
Member Avatar for elamigosam
Member Avatar for akulkarni

A) Use [icode] <script type="text/javascript>[/icode], not [icode]<Script language="JavaScript">[/icode], it's old and the language attribute is deprecated B) Your code doesn't actually do anything since it's never called (or at least, it'll always fail as soon as the page loads C) [code=html] <head> <script type="text/javascript"> var validateUsername = function () { …

Member Avatar for Troy III
0
123
Member Avatar for armyguydave69

[QUOTE=armyguydave69;996456]They do look good; however, I need one that's going to offer unlimited space and bandwidth. I have found two I do like, is there anyway to do a test (maybe through ping) or something to check out the reliability of the server and make sure they have good load …

Member Avatar for diafol
0
127
Member Avatar for sandeepjsnair

[quote]Show all steps and derivations to receive full credit.[/quote] Sounds like you better get going. You could start by showing us some of what you've tried already or by explaining bits you don't understand. After all, this is your first post so maybe you missed the GIGANTIC text at the …

Member Avatar for ShawnCplus
-1
86
Member Avatar for hemgoyal_1990

Show us your current code, we don't know you database schema or what to change if you don't

Member Avatar for hemgoyal_1990
0
73
Member Avatar for jakesee
Member Avatar for Tom Gunn
0
148
Member Avatar for dorkwad

Or you could just do [code=php] <script type="text/javascript"> var somejsarray = <?php echo json_encode($somephparray) ?>; </script>[/code]

Member Avatar for wilch
0
377
Member Avatar for Phil++

None that I know of. That's a very strange question for a programming language. It's not like using PHP kills babies or something. The only thing that could even be remotely construed as an ethically related issue is the decision between open/closed source which I'll let you search for on …

Member Avatar for ShawnCplus
0
40
Member Avatar for bops

Please elaborate on "does not work", does it give errors or just not print anything?

Member Avatar for jean3167
0
142
Member Avatar for edgar5
Member Avatar for edgar5
0
137
Member Avatar for nateuni

It's syntactically correct and there's really no harm in it except for the fact that its a complete waste since the reason you have a function returning a value is because you want to use it. If you don't want to return a value then a function returns void. [code=c] …

Member Avatar for gerard4143
0
131
Member Avatar for Silvershaft

Try actually putting something in your catch statement. And if you're not getting anything there then take the old-fashioned approach and just put asserts/couts along your code to see where it dies [CODE=c++]catch (sql::SQLException &e) { }[/CODE]

Member Avatar for yonghc
0
241
Member Avatar for dwdata

[code=php]$row=mysql_fetch_array($result); $vValue = $row['vValue'];[/code] You're fetching one row before your while loop so its essentially doing nothing with the first row

Member Avatar for ShawnCplus
0
78
Member Avatar for justted
Member Avatar for nasado
0
941
Member Avatar for itsjareds

A) Don't bump like that, its annoying. B) Try Element.prototype. If that doesn't work I have no idea since both Object.proto... and Element.proto... worked for me.

Member Avatar for Troy III
0
202
Member Avatar for empoor
Member Avatar for dasatti
0
217
Member Avatar for baudday

[icode]var_dump($filename);[/icode] inside the foreach loop and post the output

Member Avatar for baudday
0
96
Member Avatar for Trekker182

You create your list as [icode]list <char>[/icode] but your function prototype never defines a template type, you just have [icode]list[/icode]. So you could either make the function templated or you can always assume [icode]<char>[/icode] [code=c++] template <typename T> void sort(list<T> ch) { ch.sort(); } sort<char>(ch); // or void sort (list …

Member Avatar for Trekker182
0
198
Member Avatar for heroic

[url]http://www.imagemagick.org/Magick++/tutorial/Magick++_tutorial.pdf[/url]

Member Avatar for Talguy
0
147
Member Avatar for mz_rigel

You might want to try compiling and working your way through the errors. These two lines will definitely cause issues. [code=c++]// call function calcAverage int calcAverage(int score1, int score2, int score3); // call function printStars void printStars(int avg, int id);[/code]

Member Avatar for KonkaNok
0
121
Member Avatar for digitaldancer
Member Avatar for ShawnCplus
0
67
Member Avatar for jen140

[QUOTE=jen140;987024]Good day. I want to create a small app that would take out the content from a rss feed and posteriorly from the url . I know that would be easily done in perl with regular expressions, but in php it seams a bit more difficult. So i want to …

Member Avatar for jen140
0
114
Member Avatar for jasinwa

well a quick first guess would be did you have the computer on a carpeted floor when you had the case open, you might have ran into a little ESD on the memory when you had it open you be remarkably surprised at how little it takes to ruin memory. …

Member Avatar for wont
0
260
Member Avatar for somedude3488

Hmm, have you seen sprintf or does this serve a different purpose? This could be great if the function took, say, a callback function that could be used to validate fields that were passed to it.

Member Avatar for somedude3488
0
152
Member Avatar for sammy95

I would suggest that you think of a way to make it a bit more secure than simply posting any email you get to the web but if that's what you want to do IMAP is probably the way to go. [url]http://php.net/imap[/url]

Member Avatar for ShawnCplus
0
56
Member Avatar for railto

PHP Directory functions, the examples are in there: [url]http://php.net/dir[/url]

Member Avatar for railto
0
148
Member Avatar for ned69

Where you have [icode]mysql_query($sql_updt) or die(mysql_error());[/icode] put [icode]echo $sql_updt;[/icode] and paste the the output here

Member Avatar for ned69
0
130
Member Avatar for vssp

[QUOTE=ctrl4ltdeleteme;815118]ugh, php can be so hacky sometimes. Though I guess you could just put that in a wrapper function or something.[/QUOTE] Setting a cookie to the past has nothing to do with PHP being hacky, it forces the browser (which is what's being hacky) to delete the cookie which is …

Member Avatar for click here
0
1K
Member Avatar for Aamit
Member Avatar for Chad Gary

Here's a hint: You want to use both. The PHP shouldn't be a "backup" since you can't trust client-side validation. Client-side validation is nice to give users some feedback but it can also be malicious.

Member Avatar for ShawnCplus
0
134
Member Avatar for francis123
Member Avatar for MattyRobot

You would use the function just like you would inside another function. With the example code afunction isn't defined (there is no prototype.) You could do something like this [code=c++] void afunction(); // function prototype class example { public: example(); ~example(); void doSomthing() { afunction(); } }; void afunction() { …

Member Avatar for rughead
0
158
Member Avatar for valonesal

[code=php] <?php // create short variable names $searchtype=$_POST['searchtype']; $searchterm=trim($_POST['searchterm']); if (!$searchtype || !$searchterm) { echo 'You have not entered search details.'; exit; } if (!get_magic_quotes_gpc()){ $searchtype = addslashes($searchtype); $searchterm = addslashes($searchterm); } $db = new mysqli('localhost', 'username', 'password', 'database'); if (mysqli_connect_errno()) { echo 'Error: Could not connect to database. Please …

Member Avatar for valonesal
0
143
Member Avatar for Pleasant Day

You won't be able to change the style of alert() windows since the browser decides what they look like. You could, however, create your own modal dialogs using lightboxes. Google around for lightbox or thickbox. [url]http://jquery.com/demo/thickbox/[/url]

Member Avatar for ShawnCplus
0
215
Member Avatar for veledrom

Tomcat is traditionally used for Java, not for PHP. WAMP was made to be a turnkey PHP server

Member Avatar for ShawnCplus
0
124
Member Avatar for rashid47010

[QUOTE=rashid47010;981877][code=php] $TeacherInterrupts = true; $counter = 1; while ($counter < 11) { print(" counter = " + $counter + "<BR>"); if ($TeacherInterrupts = = true) break; $counter++; } [/code] Dear concern I want to know the "+$counter+" meaning and I am also getting the parse error on line #4 please …

Member Avatar for ShawnCplus
0
96
Member Avatar for Menster

Then just get the absolute positions of both then subtract the item you want's position from the item that it's relative from. [code] Box1 : x 100, y 200 Box2 : x 234, y 123 Box2 Relative Box1: x 134, y -77[/code]

Member Avatar for Menster
0
142
Member Avatar for shockeye

You'd need something along the lines of this [code=javascript] function changeClass(elem, className1,className2) { elem.className = (elem.className == className1)?className2:className1; } [/code] Then the anchor would look like this [code=html]<a href='#' class='class1' onclick='changeClass(this,"class1","class2");'>Hello World</a>[/code]

Member Avatar for codejoust
0
246
Member Avatar for happygeek
Member Avatar for happygeek

The End.