408 Posted Topics

Member Avatar for jamesjohnson25

likely because you are passing limit twice, once as a const int, and then trying to cast it as an int when it is clearly a const int. My C++ is not the best, but Im pretty sure you can't do what you are doing :-/ You stronly type for …

Member Avatar for aleeha.saqib.5
0
225
Member Avatar for Darsh95

onclick="Calculate();" (line 65) Just add the parens. Right now, your onclick method is just a pointer to a function, but does not actually execute said function.

Member Avatar for ryantroop
0
322
Member Avatar for jkon

If I recall, a websocket is just an HTTP request that gets upgraded to a persistent connection. I haven't read the spec entirely, but it's much like a 302 response, but for the WS upgrade.

Member Avatar for jkon
0
1K
Member Avatar for saranyasb

None of them alone will do much of anything. Facebook will likely have the largest user base, and will also allow public display. Twitter is more of a social communication platform. Linked In would be sorta good for your b2b market. Even if those are not your big 3 in …

Member Avatar for advent_geek
0
521
Member Avatar for Nithin_1

The query itself will determine if you have data. `"select * from table where id = 1 and date > dateadd(d, -90, NOW())"` (of course that's psudo-code so YMMV) If it returns no results it basically means you have no data. Basically, your "if exists" check can be summed up …

Member Avatar for Frederick2
0
200
Member Avatar for mitesh.24jain

I am not familliar with Sadad, but if they are like any other payment gateway, they will have an API that you must process data in a specific way and send the data to them. You will have to contact them to find out if they have a pre-made interface …

Member Avatar for mitesh.24jain
0
284
Member Avatar for JamesCherrill

I am not a JAVA developer, but I was asked to post a few simple project ideas taht are a bit cross categorical... Some ideas I came up with were: 1) A program that searches images (jpegs or otherwise), and categorizes them by either name, pixel count, or even common …

Member Avatar for Alok_5
20
3K
Member Avatar for berserk

May just be a preference thing.. but making tables on the fly like that is probably not a good idea (and resource heavy), and then you iterate through your table list with each request... Just by reading your code, trying to figure out what you intend to accomplish is difficult... …

Member Avatar for berserk
0
435
Member Avatar for Mr.M

Your problem lies with a fundamental misunderstanding of how CSS works with the DOM. You may want to read up on relative positioning, and how you center content in all its various forms. In short - you will need to start wrapping each area in containers so that the child …

Member Avatar for MidiMagic
0
383
Member Avatar for Gideon_1

I too went from teaching to programming. I had the same worry as you did. The best advice I can give you is to bring code examples with you to any interview, stuff you can explain in your sleep, and be prepared for the interviewer to push you past your …

Member Avatar for diafol
0
497
Member Avatar for Siberian

The canvas is a coordinate system. It is entirely pixel based (I may be over simplifying..), and it starts at left 0,0.

Member Avatar for Siberian
0
197
Member Avatar for AntonyRayan

You have two options: 1) Ajax instead of a form post. This way, the page never refreshes. 2) The form page will need to consume the previous form post, and set the values to match the incoming data - basically, setting the values on page load after a submit. example …

Member Avatar for Gideon_1
0
3K
Member Avatar for King_Of_lords

Your JS function needs to accept a parameter, and the PHP ouputs said parameter... while($row = mysql_fetch_array($res)){ echo "<tr>". "<td> <p><button onclick=func({$row[0]}) >View</button></p> </td>" ."</tr>"; is technically "fine" (assuming $row[0] actually prints something), though I do not think you should have a <button> tag inside a <p> tag. You may …

Member Avatar for Gideon_1
0
601
Member Avatar for theredhosting

Part science, part art. It's a way to challenge ourselves to solve new (to us) problems, and give us a puzzle to not only solve, but improve upon when everything finally works. It is a beautiful, fairly universal mode of communication, and there is just something so peaceful about code …

Member Avatar for bordogamesdev
1
420
Member Avatar for phoenix254

http://www.tutorialspoint.com/html5/html5_websocket.htm unlike everything else in JS, objects are generally CamelCase as opposed to pascalCase :-/

Member Avatar for ryantroop
0
2K
Member Avatar for vizz

I dont mean to be a buzz kill... but why not just do a setTimout for 10000ms and reload the page? `setTimeout(function() { location.reload(); }, 10000);` Then, you don't have to keep track of your own delay... :-/ If you want to keep track of it.. function CheckTime() { var …

Member Avatar for ryantroop
0
1K
Member Avatar for Aeonix

Once you return something in JS (and most other languages) any data further down is ignored. So, your scoped "name" function returns with firstName + lastName, and the rest is forgotten. I cannot think of any way to do what you want without making a new method Instead... function person(first, …

Member Avatar for Aeonix
0
227
Member Avatar for PyTis

> The only words that would get skipped over without executing code would be ones that are actually generated on the fly. But that rarely actually happens in code. Hah! Tell that to front end developers.

Member Avatar for jwenting
0
299
Member Avatar for Simon_4

The only way to dynamically size an iframe is to let the frame load and at the end of the onload event make a call to the parent that returns the content's scrollHeight and scrollWidth. You *can* do it the other way (by querying downward) but in my experience you …

Member Avatar for diafol
0
318
Member Avatar for Betterwebsites4u

This may answer your question: http://stackoverflow.com/questions/8898077/copying-the-value-of-a-forms-file-input-field-to-another-forms-input-field tl;dr: It's a security risk to simply apply an input's file data to another form element. You would need to clone it directly, and append the cloned node.

Member Avatar for lps
0
638
Member Avatar for savedlema

Based on your use case, I do not think that a hash is sufficient for your needs. A hash is one-way, and then you do a comparison lookup against the hash. What you seem to want is encrypted text, with a method for decryption within your application. Depending on your …

Member Avatar for ryantroop
0
1K
Member Avatar for rpv_sen

I believe you are missing your leading slash.. RewriteRule ^/([a-zA-Z0-9-/]+).html$ /article.php?url=$1 Also remember, do MOST specific to LEAST specific. So, your order is incorrect. You also seem to be missing some flags that will terminate the rewrite, and you possibly have yourself stuck in a loop so apache ignores the …

Member Avatar for ryantroop
0
477
Member Avatar for AntonyRayan

You will have to be a bit more clear on your goal. When you say session, are you talking about a PHP session? A cookie? The current "browser session"? Perhaps detail your idea, and we can help give you direction on how to accomplish it. :)

Member Avatar for lps
0
211
Member Avatar for castajiz_2

generally, the way this works -- the you write your connection + query in PHP, gather your data, and use PHP to format the output. This can be its very own .php page, or a library, or however you see fit. Since PHP will format your output (and set the …

Member Avatar for TexWiller
0
316
Member Avatar for Brian_15

your sql query has an error in it. Nothing to do with your VB script, unless the intention is to write a handler for an SQL error - in which case, you should probably handle it :-/

Member Avatar for jhai_salvador
0
148
Member Avatar for Aeonix

They are out there. More likely, you will find companies that make automated pen-testing tools, which they license for use on your system. Their job is to update their tools to attempt to breach your system using common (and some less commong) hacks and methods. You, of course, are also …

Member Avatar for ryantroop
0
213
Member Avatar for network18

That... looks very unfamilliar to me in terms of creating and running procedures... try this instead: delimiter // drop procedure if exists GetEvents// create procedure GetEvents(IN iVal1 int, IN iVal2 int) begin select * from myTable where Col1 = iVal1 and Col2 = iVal 2; end// delimiter ; then to …

Member Avatar for cereal
0
4K
Member Avatar for yankeefan24

likely the jquery is setting the "disabled" flag, which according to the HTML specs tells the browser to remove the input in regards to submitting a form. Any "disabled" input field will have the same result. Your solution is to enable all input fields immediately before submitting (which you can …

Member Avatar for yankeefan24
0
296
Member Avatar for Aeonix

All the best security flaws are implemented with the best of intentions. Tomorrow, your C# stack could blow up because a major vulnerability in .NET surfaces. Likewise, the years and years of unstructured code that is poured in from the open source community to manage and update PHP is bound …

Member Avatar for ryantroop
1
258
Member Avatar for mangel.murti

ehhh... First, Im not sure why you are wrapping a select in a transaction. May just be my not following your logic, or maybe me being naive, but Im pretty sure transactions are meant to make sure everything went smoothly on inserts or updates before committing changes. You are doing …

Member Avatar for ryantroop
0
348
Member Avatar for UK-1991

From the looks of it.. your function find_all_products() makes a database call, then you churn through the results as needed. This is just terribly inefficient. You do not seem to be changing the SQL in any way for each call, so just do it once and store the values locally …

Member Avatar for diafol
0
151
Member Avatar for mskat02

It would really help to see the whole declaration, so we can see the incoming variables. At first glance, it looks like you're doing something funny with your vars by using quotes... @'foo' should be @foo, And in MySQL, I have found more success just avoiding user declared variables and …

Member Avatar for ryantroop
0
292
Member Avatar for JasonWung

I *think* what priteas is trying to get across to you is that you need to change your thinking. Consider it this way: "only display the box when there are images to display." That way, you are not trying to "fix" something post render or mid build.

Member Avatar for ryantroop
0
199
Member Avatar for davy_yg

Whatever system you use to process payment (either a payment gateway directly, or a service like paypal) will likely have a copy/paste or include PHP script for simple transactions that you call (like a function, or doing a cURL call to), or a more robust API that you can make …

Member Avatar for ryantroop
0
213
Member Avatar for Cemplysam

You're on it. What would you like to know about them? (Of course, I assume you checked out http://php.net/manual/en/book.session.php)

Member Avatar for ryantroop
0
51
Member Avatar for tiredoy

While I don't agree with your use of an anonymous function to attach an anonymous function to a node to alert the value (... yup, that sounds right), it seems that you are trying to get the text value of the first node. So, you are looking for the innerText(for …

Member Avatar for tiredoy
0
323
Member Avatar for MarkDbro

heh... I think diafol was trying to say why not store the images on a web server, and only store the paths (ex: http://mysite.com/images/myimage.jpg) to the images on that web server in the database - that way you are only retrieving a small amount of text (the URL) as opposed …

Member Avatar for MarkDbro
0
1K
Member Avatar for jay.barnes

for sure, this is broken: public function get_validator(){ return $this->response_code; return $this->response_msg; } once you return out of a method, you're done. It does not continue to process. Other than that.. not sure what you are not understanding... If you get a response from your class, take the value and …

Member Avatar for jay.barnes
0
420
Member Avatar for nibbler

Pretty much every rewrite I have seen uses some form of regex to capture the condition. (twitter.com) will look for the exact string "(twitter.com)" as far as I understand it. Maybe try using a simple regex to meet your needs - RewriteCond %{HTTP_REFERER} .*twitter.com.*$ [NC] Also, while I don't ultimately …

Member Avatar for nibbler
0
351
Member Avatar for v1shwa

you, sir, are building a proxy (at least, that's what it sounds like to me). Feel free to read about that: http://en.wikipedia.org/wiki/Proxy_server There are many PHP proxy scripts you can snag. Glype, I believe, is very popular. There are other alternatives, including some from google. However, the way you are …

Member Avatar for jkon
0
401
Member Avatar for spud91

1) Are you sure that you dont have error notification turned off in PHP? 2) Perhaps you need to free your current mysqli resource, as you may be getting an unfreed cursor state. 3) Users in line 50 is not users in line 79 :-/ As a note of concern, …

Member Avatar for jj.dcruz
0
266
Member Avatar for habib rahman
Member Avatar for CaffeineCoder

So... a couple questions I guess... If you have a form, why are you using AJAX? What is trim()? Have you used F12 tools to see if you are generating an error? If so, what is it? I also don't understand your regex... try using a too like: https://regex101.com/ to …

Member Avatar for CaffeineCoder
0
288
Member Avatar for Heanre

Looks good to me... if you have no records, and you have no limiter (where clause), you obviously have nothing in there. You could also do "select 1 from stafftable limit 1" and it will probably be faster, but if your goal is to use the data (as yours appears …

Member Avatar for almostbob
1
154
Member Avatar for makungu

SCENARIO Student tries to write code to solve their problem. When they cant figure it out on their own, they go to message boards to get help finding where they went wrong. HINTS: The student is you, bro :( Show Some Code

Member Avatar for deceptikon
0
93
Member Avatar for aseel.jaradat.9

Each user has a specific, unique, identifier, yes? Pre-pend your root object with that decorator. Ex: UserData:{foo:1}; Can instead be: 1331UserData:{foo:1}; Then your code can look for said data by something like: localStorage[userID + "UserData"]; Mind you this is all pseudo code so you'll still have to do some work. …

Member Avatar for aseel.jaradat.9
0
429
Member Avatar for Stefce

Are you getting an error? First look says no ending semicolon... Other than that, depends on the table and what values it expects. Try listing out the columns explicitly and see if that helps. I'm also assuming the first column is your id and you may be passing a blank …

Member Avatar for broj1
0
221
Member Avatar for Rizi004

You would likely need a second table that keeps track of the "state" of the record being read. Either that, or a column that flags a "read" state. Using a separate table, however, you can also relate a user id or other relevant information. I am not 100% certain, but …

Member Avatar for rubberman
0
210
Member Avatar for Tom_11

Your input name and the name in your post do not match. When debugging things like this, it may help to use var_dump(), particularly in your case var_dump($_POST); and see what you get.

Member Avatar for ryantroop
0
177
Member Avatar for ivel

You will need a for loop and an understanding of modulus, and a little bit of good old fashioned logic. Good luck!

Member Avatar for NathanOliver
0
293

The End.