AnonAccount: What is it, and what does it do? - Q&A Thread
Leave these fields empty (spam trap):
You can leave this blank to post anonymously, or you can create a Tripcode by using the float Name#Password
A subject is required when posting a new thread
[*]Italic Text[/*]
[**]Bold Text[/**]
[~]Taimapedia Article[/~]
[%]Spoiler Text[/%]
>Highlight/Quote Text
[pre]Preformatted & Monospace text[/pre]
1. Numbered lists become ordered lists
* Bulleted lists become unordered lists


Changing Variable Type, C++ by Walter Genninghood - Thu, 03 Apr 2014 09:12:43 EST ID:YaL0+ciH No.31415 Ignore Report Reply Quick Reply
1396530763127.jpg -(32565 B, 1280x1024) Thumbnail displayed, click image for full size. 32565
Quick one: basically written a small piece of code in C++ that computes a numbers factorial. Works fine with everything as integers, until you enter a number too large for it to handle as an integer. So, I tried changing the integers and instead declare them as long integers, or even as double, but all I get is 'error: type 'double' unexpected' or 'error: type 'long' unexpected'. Why? It's only changing the variable type, won't it work?


using namespace std;

long factorial1(int k){
int i=0,factk=1;
Comment too long. Click here to view the full text.
Clara Hammlepock - Thu, 03 Apr 2014 12:45:55 EST ID:I31z+CiS No.31417 Ignore Report Quick Reply
factk and factnk are longs
factorial1 and factorial2 are expecting ints
in your functions factk and factnk are ints
in your functions you are expecting to return longs

Just got my first programming job by Betsy Murdspear - Tue, 21 Jan 2014 22:46:43 EST ID:oBwzzKeU No.30770 Ignore Report Reply Quick Reply
1390362403843.jpg -(16223 B, 298x300) Thumbnail displayed, click image for full size. 16223
Tell me your experiences from first day to training until your first real project.

I just need to know what to expect. The company I work for uses VB .NET and SQL Server.
27 posts and 1 images omitted. Click Reply to view.
Edwin Pambleforth - Tue, 25 Mar 2014 01:54:22 EST ID:oBwzzKeU No.31340 Ignore Report Quick Reply

I wish this were possible, man. The entire application suite I work on is critically dependent on SQL. A lot of it is through databinding though (which is basically voodoo to me).
Barnaby Sonnerwot - Tue, 25 Mar 2014 20:47:33 EST ID:dYhKX+UP No.31341 Ignore Report Quick Reply
Web developer here. Not in the same realm, obviously, but I agree with this sentiment. Speaking from my experience, however limited, I would personally much, much prefer to work with someone who is honest (with themselves and their teammates) about their abilities and asks "too many" questions than someone who thinks they're a rockstar, overstates their abilities and asks questions that they later disregard or forget the answers to.
Martha Greengold - Wed, 02 Apr 2014 18:49:25 EST ID:CjiZuQru No.31409 Ignore Report Quick Reply
This really depends on the complexity of the query and the size of the resulting data set. In most cases yes, keep it in the database for as long as possible, especially if you're dealing with large result sets. In many cases network transport is a major bottleneck.

I've seen a few rare cases where the transport from DB to application and doing the processing there was worth the extra overhead from transport. This could've been related to the fact that this involved a database inherited from a legacy application and re-factoring it had major implications.

Most programmers seem to have a meager grasp of SQL, which is a shame. If you have the chance to brush up on SQL, do it.
Ebenezer Hanningstock - Thu, 03 Apr 2014 07:48:35 EST ID:9izVXXkm No.31414 Ignore Report Quick Reply
Web development isn't that different from software programming, in my opinion.
Walter Grandwell - Thu, 03 Apr 2014 11:09:50 EST ID:e4FccTus No.31416 Ignore Report Quick Reply
If you think programmers' knowledge of SQL is bad, try finding any with a solid understanding of relational theory and data modeling. I'd wager more database programmers understand general relativity than databases.

How I was not using pointers in Python or C#? by Ebenezer Brurrymerk - Sun, 30 Mar 2014 22:07:48 EST ID:y5msItfq No.31391 Ignore Report Reply Quick Reply
1396231668750.jpg -(34575 B, 575x332) Thumbnail displayed, click image for full size. 34575
Comment I'm just starting with C++ and I've made that:
HalfByte a, b;
HexByte x;
a = (int)byteAnswer[i-1];
b = (int)byteAnswer;
for (HalfByte *h : {&a, &b}) {
if (*h >= (int)'0' && *h <= (int)'9') {
*h = *h - (int)'0';
else {
*h = *h - ((int)'a' - 10);

Pointers are annoying but... I can see the reason why they are there. The logic is clear. But... how other languages can "just work" without them? You know, under the hood... I was never thinking about it and now I've learned how to use them - it's unclear for me when I was using cloned objects, references and the same objects in higher-level languages; now I see why people say C++ is good to learn - with other languages you don't really need to understand a lot of things, they just happens.
2 posts omitted. Click Reply to view.
Edward Honeywill - Tue, 01 Apr 2014 14:19:46 EST ID:a3cgL5Kr No.31397 Ignore Report Quick Reply
Okay, that makes sense.
Walter Blatherman - Tue, 01 Apr 2014 15:26:46 EST ID:gpyECHx+ No.31398 Ignore Report Quick Reply
> You can't dereference them or increment them or get their value, but they are there.
i miss incrementing pointers almost as much as i miss goto
Hugh Nangerdale - Tue, 01 Apr 2014 19:17:26 EST ID:yDJii+Es No.31399 Ignore Report Quick Reply
1396394246341.gif -(28445 B, 632x680) Thumbnail displayed, click image for full size. 28445
I feel the same, op. Before learning c I was good about tracking values for things like

a = b
b = c
b += 5
a = ?

ever since, I have no clue wtf is going on if I don't see the actual pointers. In javascript I've learned to just go as deep as possible with assignments. PHP is a trainwreck with a reference operator a = &b. its okay though, just output what youre working with and unit test and its not really a problem.
Martin Borringville - Wed, 02 Apr 2014 15:37:15 EST ID:vhgZIlcV No.31406 Ignore Report Quick Reply
You do know that C++ also has references.
In the theoretical level pointers and references have the difference that pointers are thought to have memory addresses as values, whereas references are just thought as references to some other values.

The actual difference between pointers and references in C++ is that you can do pointer arithmetics, but not reference arithmetics.
Java references are not pointers, they are references. I don't know for sure about C#, but I do believe the same holds.


Actually what could be a problem here isn't pointers, but actually references.
If a, b and c were pointers, you are just calculating new addresses, not values at all.
The computation of the addresses would be as simple as for simple (non-pointer non-reference) values.

But if a, b and c are actually references, say b is a reference to a, then you
Comment too long. Click here to view the full text.
Martha Greengold - Wed, 02 Apr 2014 18:39:48 EST ID:CjiZuQru No.31408 Ignore Report Quick Reply
This! Pointers aren't references.

C# (and all .NET languages for that matter) use garbage collected references. C# does offer features allowing you to work with pointers and pinning memory so it isn't garbage collected.

Pointers are useful but come with the price of having to clean up after yourself (failing to do so leads to memory leaks) and the ability to totally mess up the memory by reading/writing across boundaries. or dereferencing free'd memory. Higher level languages tend to abstract those things away at the cost of some speed.

If you're interesting how the .NET framework manages its memory, have a look here:

In most cases this loss is of little significance to program execution. Whenever possible I still prefer to std:unique_ptr<T> or std::auto_ptr<T> (aka smart pointers). To quote wikipedia on C++ smart pointers:
>Smart pointers can facilitate intentional programming by expressing the use of a pointer in the type itself. For example, if a C++ function returns a pointer, there is no way to know whether the caller should delete the memory pointed to when the caller is finished with the information.

Background process with C++ by Graham Fullerhed - Thu, 27 Mar 2014 22:27:09 EST ID:cr3hSQU+ No.31377 Ignore Report Reply Quick Reply
1395973629516.jpg -(223426 B, 1178x1080) Thumbnail displayed, click image for full size. 223426
I'm creating this C++ application which communicates with via serial port with dedicated device. I have a problem as when I'm waiting for the device to respond - all the GUI stops... I was expecting that but it's more problematic than I've thought. I was trying to google "multi threads" and "multi processes" but I'm not really sure what I need and how to bite it... I was only using C# and Python before, now I need to switch to C++ (not for this job but for the next one - I need to be prepared) with no knowledge and C++ Primer being so big, bad book... ;-)
Emma Brobbleledge - Fri, 28 Mar 2014 02:31:01 EST ID:ZMQnkpih No.31381 Ignore Report Quick Reply
What OS and API are you using?
Graham Fullerhed - Fri, 28 Mar 2014 08:37:07 EST ID:cr3hSQU+ No.31385 Ignore Report Quick Reply
1396010227516.gif -(1543172 B, 640x360) Thumbnail displayed, click image for full size. 1543172
I'm on Linux right now but the software will have to run on Windows too. I hope the changes I'll need to make won't be really big... I'm using Qt API, they added rs232 support lately.
Shitting Weshgold - Sat, 29 Mar 2014 12:55:12 EST ID:AKW6IIfj No.31388 Ignore Report Quick Reply
1396112112545.png -(28315 B, 413x360) Thumbnail displayed, click image for full size. 28315
> I was expecting that but it's more problematic than I've thought
i guess the frustration from long waits won't be relieved much if the result of the serial communication is important to the work-flow
Ebenezer Brurrymerk - Sun, 30 Mar 2014 22:00:37 EST ID:y5msItfq No.31390 Ignore Report Quick Reply
Yes but you can prepare next command in that time. And my boss don't want blocked GUI as "it's ugly". ;-)

Education VS the real thing by Ebenezer Pickson - Thu, 27 Mar 2014 03:25:50 EST ID:N6CX5RYK No.31358 Ignore Report Reply Quick Reply
1395905150441.jpg -(19616 B, 360x239) Thumbnail displayed, click image for full size. 19616
I'm in Canada, doing a degree in "Computer Science" in college. I put Computer Science in quotes because it's not really computer science, it's more like IT support/programming, but whatever.

The issue is that I have maybe a year left in my program then I'm out free, but I don't feel ready at all. We learned Java and HTML/CSS in our first year, and I was good at both, but we barely scratched the surface in Java. We then went to PHP and VB.NET, which I was also good at, but we never got far. In every language we would stop as soon as we began dealing with databses. We would start out with simple input/output calculation stuff, forms and so on. Then go to reading/writing files, then finish with doing all that stuff but with MySQL. I think within the next year I will only be doing one language, which is VB.NET, and we will be expanding on it in a completely vaguely named course called "Advanced VB.NET".

No C++, no C#, and I feel like those two are extremely important languages in a work environment. I plan on working in a video game company, and at the worst, perhaps a software company. Yet I'm learning stuff like Systems Analysis and Design, Networking and Accounting (????), and they're all terrible survey courses where we read Powerpoint slides and do multiple choice tests.

Basically, by the end of my education, I will know HTML/CSS, PHP, VB.NET and Java. Is that enough to do well in any work environment? I get high grades but I also feel like that is a result of my teachers being extremely easygoing. I've been working on the side messing with scripting for Unreal Engine 4 and Unity, as well as doing freelance web design work (which I really enjoy, moreso than any other coding I do), but I feel like after my education the only jobs available will be boring office jobs where I code for some unknown company that will probably go under in a few years. There is an upside, I live in Montreal which is basically the Mecca of video game development, so I have many options, but I feel like I'm gonna have to bust my ass outside of school to learn what they should be teaching me in the first place. Then there's the fact that I know absolutely no theory. …
Comment too long. Click here to view the full text.
Nathaniel Pindertog - Thu, 27 Mar 2014 10:56:58 EST ID:yDJii+Es No.31359 Ignore Report Quick Reply
>do you think someone like me would be ready to work straight out of college?


>I feel like I'm gonna have to bust my ass outside of school to learn what they should be teaching me in the first place.


lol video games in good luck, i got a useless degree in economics before teaching myself programming so at least you got a head start.
Fanny Trotstock - Thu, 27 Mar 2014 11:08:13 EST ID:dUqCye/w No.31360 Ignore Report Quick Reply
If you still have a year left, make absolutely sure you do an internship this summer. No question, you need some real-world experience before you are ready for the workforce, but an internship will go a long way toward getting you there. If you don't do an internship or get a part time job, you won't be ready for full-time work as a developer after you graduate. You owe it to yourself.

HTML Button to Delete Files by Esther Fuckingwell - Wed, 26 Mar 2014 22:58:41 EST ID:hFe8ZVfN No.31351 Ignore Report Reply Quick Reply
1395889121625.jpg -(1581 B, 66x26) Thumbnail displayed, click image for full size. 1581
Hello. I need some help with this problem here. Most solutions I've found online aren't working.

My approach has been to have a PHP function that does a windows command
echo exec('rmdir /s /q "files");

However I can't seem to call that function with my button.

Does anyone have any other solutions to this problem? It doesn't have to PHP. And it does NOT have to be secure in any way.

17 posts omitted. Click Reply to view.
Thomas Naddlespear - Thu, 27 Mar 2014 22:08:24 EST ID:dYhKX+UP No.31375 Ignore Report Quick Reply
Sorry, completely forgot about binding the handler:

$(document).ready(function() {

$('button.className').bind('click', function() {
success: function() {
alert('Files deleted');
Comment too long. Click here to view the full text.
Jack Goodstone - Thu, 27 Mar 2014 22:16:49 EST ID:hFe8ZVfN No.31376 Ignore Report Quick Reply
I tried :/
$(document).ready(function() {

$('button.className').bind('click', function() {
success: function() {
alert('Files deleted');
Comment too long. Click here to view the full text.
Thomas Naddlespear - Thu, 27 Mar 2014 23:19:08 EST ID:dYhKX+UP No.31378 Ignore Report Quick Reply

Based on your markup, try that instead. Whatever's between the quotes needs to identify your button element, whether it's by tag name, class, ID, etc. Since your button has an ID of "button" that's what you should use.

Make sure the path to your delete.php file is correct. Do you know that the leading slash signifies that the file should be in your web root?

Use Firefox with Firebug and keep the console open to be alerted to any JS or network errors.
Jack Goodstone - Fri, 28 Mar 2014 00:58:49 EST ID:hFe8ZVfN No.31379 Ignore Report Quick Reply
Getting an error with this line
$(document).ready(function() {

Im looking it into it though... this is jQuery right?
Jack Goodstone - Fri, 28 Mar 2014 01:04:04 EST ID:hFe8ZVfN No.31380 Ignore Report Quick Reply
1395983044887.jpg -(2850 B, 126x116) Thumbnail displayed, click image for full size. 2850
Hooray, tis fixed! I added this line at the very top

<script src="//"></script>
<button id="button" value="button" >Delete</button>
$(function() {

$('#button').bind('click', function() {
success: function() {
alert('Files deleted');
Comment too long. Click here to view the full text.

What's with Qt licenses? I'm puzzled. by Whitey Pinderkan - Wed, 26 Mar 2014 21:42:20 EST ID:cr3hSQU+ No.31349 Ignore Report Reply Quick Reply
1395884540810.jpg -(179162 B, 768x1024) Thumbnail displayed, click image for full size. 179162
Qt is licensed under GPL and LGPL (what's the point of GPL then? LGPL is less restrictive, right?) next to commercial license... so what's the point of commercial license if there is LGPL too? I mean... simple question: can I use Qt library to create closed source application and then sell this application without paying a thing? I ask because I just got a job and I need to pick some toolkit to work with - I was never concerned about this licensing stuff as I was using Swing in Java... now I need to use C++ and I'm really lost reading all that law things...
Shit Brunnerbanks - Wed, 26 Mar 2014 22:22:46 EST ID:xtelIQ1k No.31350 Ignore Report Quick Reply
>can I use Qt library to create closed source application and then sell this application without paying a thing?

You can dynamically link to LGPL binaries, yes. If users can update/replace the library binary at will, then you're good to go. Although I'm not a lawyer and you should look carefully at the terms of all licenses you use. Doubly so if it's your job.
Fanny Trotstock - Thu, 27 Mar 2014 11:13:38 EST ID:dUqCye/w No.31361 Ignore Report Quick Reply
Yes, you can develop closed-source Qt software as long as the Qt libraries are dynamically-linked. If you statically link them (by compiling them into the executable) you must release your software under a license compatible with LGPL.
Phineas Wettingfoot - Thu, 27 Mar 2014 12:02:51 EST ID:CmcHTLaD No.31362 Ignore Report Quick Reply
>first HDMI to H2O
Whitey Pinderkan - Thu, 27 Mar 2014 15:13:56 EST ID:cr3hSQU+ No.31365 Ignore Report Quick Reply

Basic Unix For Loop by Cedric Goodfoot - Wed, 26 Mar 2014 16:57:35 EST ID:Iq3cb5UA No.31345 Ignore Report Reply Quick Reply
1395867455503.jpg -(70147 B, 399x465) Thumbnail displayed, click image for full size. 70147
Anyone able to tell me what this basic Unix For statement would do:

for p in $ ( ls )
[ -r $p ] && more $p

Eugene Moblingmune - Wed, 26 Mar 2014 17:54:32 EST ID:T3FPGpDn No.31347 Ignore Report Quick Reply
For every file and folder in this folder
do something...
Eliza Binningford - Wed, 26 Mar 2014 17:58:15 EST ID:D0GuSL2t No.31348 Ignore Report Quick Reply
>do something...
If the file exists and is readable open it with more

Java Script or Python for desktop scriping by Betsy Gebblechark - Thu, 13 Mar 2014 18:54:27 EST ID:ak5YKDGE No.31219 Ignore Report Reply Quick Reply
1394751267595.png -(23410 B, 521x99) Thumbnail displayed, click image for full size. 23410
Which would you recommend for scripting the monotony out of my office drone job? Like moving, reading and running files?
Java Script is already off to a bad start when I had to call CreateObject("Scripting.Runtime") just to create a text file. That's the same as VBA which I am trying to move away from. Also all of the documentation is for web development.
5 posts and 1 images omitted. Click Reply to view.
Oliver Piddlematch - Sat, 22 Mar 2014 15:07:32 EST ID:ak5YKDGE No.31308 Ignore Report Quick Reply
I have access to JavaScript and VBA now but I have to ask the IT dept to allow me to install Python.
It was actually CreateActiveXObject( but we/
How do you do files system operations in JavaScript then?
Cyril Senninglut - Sat, 22 Mar 2014 21:39:50 EST ID:oYcIymyc No.31313 Ignore Report Quick Reply

You don't. Javascript interpreters don't even let you leave the web browser these days anyway for very obvious security reasons.
Matilda Nebberworth - Sun, 23 Mar 2014 00:11:59 EST ID:4wql24nm No.31315 Ignore Report Quick Reply
If you have no Python, I'd recommend using Powershell, .NET, and plain old batch scripting. I can't tell you how much I've used those as a crutch when time was in a pinch.
Nathaniel Blatherhall - Sun, 23 Mar 2014 14:49:40 EST ID:ak5YKDGE No.31322 Ignore Report Quick Reply
I do through windows scripting shell. I can save .js files and click to run them.

I can't save .bat or powershell files. privledges etc.
Samuel Dosslestone - Mon, 24 Mar 2014 00:54:28 EST ID:oBwzzKeU No.31333 Ignore Report Quick Reply
Python all the way, OP... why on earth would you even consider JS for that sort of thing? Ruby is also really awesome. Ruby and Python are both perfect for this, and both provide excellent libraries to do much much more than regular shit.

But I actually wrote my own scripting language specifically for this, and when a script isn't provided, it's an interactive programmable commandline shell.

Also, to the guy who mentioned .NET, remember OP is talking about scripting.

Ruby by Hedda Bardworth - Wed, 19 Mar 2014 14:13:13 EST ID:Vrrmdvgy No.31279 Ignore Report Reply Quick Reply
1395252793505.png -(196597 B, 995x996) Thumbnail displayed, click image for full size. 196597
Hello, I am completely new to programming and decided to learn ruby as my first language, but I heard it was an interpreted language, and was hoping to ask other ruby programmers if it was possible for people other than myself to interpret my code without the ruby interpreter, through like the web or something cause I want to make a text game and embed it on a website, is this possible?

Side note: I was reading in this ruby book I got from the library that I could create a dummy connection with sql and was thinking it would probably be easier just to make a multi-user-dungeon or something.
Angus Neddleforth - Wed, 19 Mar 2014 22:34:05 EST ID:5DncEJD6 No.31280 Ignore Report Quick Reply
You can embed (text-based) things on websites without having to write them in javascript, which is what runs natively in browsers, but you'll have to host the ruby process yourself somewhere if you want other people to use it, which basically means getting a server in The Cloud. This can be free for very low-traffic stuff, but is also complicated and not a good total newbie project. (protip: SQL is not involved in this step)

I'd focus on making your game work with standard input/output locally first.
Doris Civingput - Thu, 20 Mar 2014 10:35:52 EST ID:ofxrUehR No.31283 Ignore Report Quick Reply
>through like the web or something cause I want to make a text game and embed it on a website, is this possible?
There's probably a compiler somewhere that'll compile your Ruby to JavaScript so your game could run in a browser without any additional downloads, but it may be slow and unwieldy.

>new to programming
Sadly, it'll be years before you're ready to make a decent game. Don't despair though, just make sure to learn/make something new every day and you'll get there eventually. Focus on learning the basics first.
William Sunderworth - Sun, 23 Mar 2014 18:00:30 EST ID:SkgVApkK No.31328 Ignore Report Quick Reply
"2048" is a viral game going around and coded in .js, but there are Ruby clones of it everywhere
Samuel Dosslestone - Mon, 24 Mar 2014 00:37:26 EST ID:oBwzzKeU No.31329 Ignore Report Quick Reply
Sort of. There are online interpreters. But if you want to embed your ruby into web pages, you should check out Rails. Heroku is a cool service that's easy to register with and host your Ruby on Rails projects at. I personally use the Aptana Studio 3 IDE for my RoR projects. Have fun.

Crypto Locker/Defence by Hannah Bocklemadge - Sun, 23 Mar 2014 14:43:30 EST ID:41soS3PY No.31320 Ignore Report Reply Quick Reply
1395600210217.png -(230592 B, 805x627) Thumbnail displayed, click image for full size. 230592
How much money do you think the creator pulls in per month?

Been considering doing something similar but the payoff has to be worth it. I think at least 50,000 usd in bitcoins.
Martha Niggercocke - Sun, 23 Mar 2014 14:47:35 EST ID:xtelIQ1k No.31321 Ignore Report Quick Reply
It's a sophisticated criminal enterprise, so probably a lot.
Hannah Bocklemadge - Sun, 23 Mar 2014 14:50:31 EST ID:41soS3PY No.31323 Ignore Report Quick Reply

50,0000 per month though?
Hannah Bocklemadge - Sun, 23 Mar 2014 16:17:14 EST ID:41soS3PY No.31324 Ignore Report Quick Reply

Fuck it. Imma work a legit job. I don't have the discipline to do it. I mean if the SR guy can get arrest who's to say I can't...
William Sunderworth - Sun, 23 Mar 2014 17:03:36 EST ID:SkgVApkK No.31325 Ignore Report Quick Reply
Pretty sure they already found out who is responsible for the cryptolocker ransomware but they are Eastern Euro/Russian so can't be extradited, therefore they can get away with writing this stuff you can't
William Sunderworth - Sun, 23 Mar 2014 17:56:09 EST ID:SkgVApkK No.31327 Ignore Report Quick Reply
Forgot to mention that it wasn't $50,000USD, it was 50,000 Btc, so figure out how much that is worth at ~$600 per coin. Cryptolocker2 is currently going around, most likely not made by the orig authors and has some better features like allowing you to still decrypt the files after the expiry date of the ransomware but uses an inferior Triple-DES algorithm that can be bruteforced. They suspect the authors are bruteforcing their own keys instead of having them automatically mailed somewhere to further elude detection and prevent their C&C servers from being discovered.

Directory Period Folders by George Dartwater - Fri, 21 Mar 2014 01:39:00 EST ID:hFe8ZVfN No.31286 Ignore Report Reply Quick Reply
1395380340952.jpg -(11300 B, 332x106) Thumbnail displayed, click image for full size. 11300
Simple question here. Is there a name for these two directories? the . and ..?

I'm trying to google how I can filter them out from a directory listing, but not getting good results because I have to search "php filter out period folders" lol
11 posts omitted. Click Reply to view.
Ebenezer Sivingbury - Sat, 22 Mar 2014 18:59:23 EST ID:T3FPGpDn No.31311 Ignore Report Quick Reply
PHP isn't the same as normal HTML, you need to run it on a server. Either one you run yourself (See: XAMMP or get an online host
Sophie Gedgefuck - Sat, 22 Mar 2014 23:16:06 EST ID:lCMiWwty No.31314 Ignore Report Quick Reply
Sorry I wasn't clear. I mean I do use WAMP to run the PHP files, but I didn't know if that code you gave (which I assume was AJAX or something) needed anything else.

So if it doesn't, then I'm not sure why it doesn't work. Have you tried that personally?
Hannah Bocklemadge - Sun, 23 Mar 2014 05:16:38 EST ID:41soS3PY No.31316 Ignore Report Quick Reply

Check your browser console (CTRL+SHIFT+J) for JS errors. Or maybe your PHP file is not set up properly. I don't know.
Whitey Guffingnat - Sun, 23 Mar 2014 05:51:21 EST ID:3dmIx9p8 No.31318 Ignore Report Quick Reply
That code should call the php file. Calling functions by name isn't something that happens automatically, you're going to have to do that yourself. Your php file might look something like:

function foo() {
return "Hello world";

echo call_user_func($_REQUEST['function']);

Passing parameters to the functions will take more work to construct an array of arguments which you can use with call_user_func_array().

There's much more to do to make this technique safe for a production project. Checking that the function exists and is allowed, serializing and deserializing input and return values, handling errors, etc.

Note that none of my code is tested - I'm just offering suggestions, turning them into solutions is left as an exercise for the reader. ;)
Hannah Bocklemadge - Sun, 23 Mar 2014 08:46:09 EST ID:41soS3PY No.31319 Ignore Report Quick Reply

Should use a switch or large if elseif statement rather than call_user_func.

<<Last Pages Next>>
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Report Post
Please be descriptive with report notes,
this helps staff resolve issues quicker.