alexdemers
-
Posts
65 -
Joined
-
Last visited
Never
Posts posted by alexdemers
-
-
Hey,
I have an object:
typeArray = ['header', 'data', 'footer', 'all'];
and I want to reference these in my array:
mainArray = { header: [0, 12, 53, 44, 2], data: [0, 5, 36, 45, 83], footer: [2, 24, 54, 44, 89], all: [5, 84, 44, 23, 6] }
I want to be able to use this:
var type = 'all'; mainArray.type[3];
But it thiniks that type is part of mainArray. Is there any way to tell JavaScript that "type" (in my case) is actually a variable and not an object/array name?
Thanks
-
As for step 2 and 3, they should be replace with viewing the source code instead:
$page = file_get_contents('http://urlofform.com/form.php');
Right and then how would you apply OCR on something like:
<img src="qmdhstqst3q3d5hq37g5hq45347tj3q56j4y78sqwrd74jy6+q84ky35s734eyk7s 78ylu4s88l4rs78ul869sr9ur9+§lu/7rs3lu874d73§lu6s346s4ku486sr">
Same way a browser does.
Folder: qmdhstqst3q3d5hq37g5hq45347tj3q56j4y78sqwrd74jy6+q84ky35s734eyk7s
78ylu4s88l4rs78ul869sr9ur9+§lu
File: 7rs3lu874d73§lu6s346s4ku486sr
It is weird tho for a folder/file name. Even if it doesn't end with jpg or whetever the format it, if it has content-type headers it will show up properly in the browser.
-
Well, you built the logic that mostly everybody would figure out in 30 seconds. Obviously it's step 4 that is the hardest part. I don't know any image recognition library in PHP (I would be surprised if there were any.
As for step 2 and 3, they should be replace with viewing the source code instead:
$page = file_get_contents('http://urlofform.com/form.php');
... and do some regex to get the image file path and then run the image recognition software of that single image.
I cannot help you further because I never had an interest in breaking/spamming/hacking web sites.
-
obviously "cart|" should not be part of the unserialization. This was probably for reference so:
$serial = substr($_COOKIE['name_of_cookie'], 5); $array = unserialize($serial);
-
$_POST('fld1') should be in brackets: $_POST['fld1']
-
Nothing wrong with that code. What's in your header.php file?
-
Try moving your include outside of myFunction()
-
yes, they are referring to register globals being removed. But FYI what you are doing is also bad coding practice.
Would it be better to pass the string?
No, this is a VERY good sign that you need to use OOP (Object Oriented Programming) or classes for your development process.
Edit: typo
-
No we can't. We can't provide you with a complete script even if it's "urgent". But, we can help you to guide you in the correct path.
PHP: file_get_contents - Manual + PHP: preg_match_all - Manual
-
For every letter find it's upside down ASCII value. On Windows, click Start (or the windows logo) then Run. In the run dialog, type "charmap" press enter. Now, let's say the user types "A", now look at the character map table and look for an upside down "A". Then, break down the user's string into an array and to str_replace of each of the letters.... and go on from there.
-
Do you have an element with the ID "navigation" surrounding your <ul> ?
-
The closes thing you can do is insert thousands of blank lines before starting to output your page. (stupid) visitors might say that the source is not available. Of course this method won't work with addons like Firebug.
Or just play with whitespace of your HTML source.
Your PHP code is already hidden.
If it's for JavaScript, minimize your code.
-
I know you already know this but the PHP docs is a damn good place to look tutorials. Most of the functions have a couple of examples, if not the user comments are always helpful.
-
... or replace $_POST['hq'] with $_POST['radio']
-
Replace id="hq" with name="hq" on your input element. Only name+value combination gets sent to the server. Nothing else.
-
-
To add to my previous response, you need to do num_rows method and not field_count method.
-
You need to store results so you can count them PHP: mysqli::store_result.
Edit: actually look at this if you are using prepared statements: PHP: mysqli_stmt::num_rows - Manual
Read the Typer85 at gmail dot com's comment at the bottom of the page.
-
COUNT(*) or COUNT(field_name)
Not just COUNT by itself.
-
Do what smerny said. If that doesn't work, try adding $tablerows = ''; before concatenating $tablerows. I may be wrong but maybe there's an error trying to concatenate with null (shouldn't be a problem).
Also, is this condition
if ($_SESSION['user_logged_in'] == true) {
being entered?
-
Well, as said in the sticky, headers should be set before any echo statements. If there's 1 byte of content, the headers will not work. You have two choices here. Either set the header before echoing the content, or do your insertion in the database before starting to output the table. So move your block of code to check/insert the comment in the database and move it before the loop to parse the table.
Make any correction if it fails.
-
Check line 60. You are already in PHP so no need to <? $_SERVER['PHP_SELF']; ?>.
Replace that with
action=\"".$_SERVER['PHP_SELF']."\"
and everywhere where you used <? ?>
Edit: Also, you shold really be cleaning your code/syntax. There's alot of confusion in there and that's where it creates problem.
-
so if i serialize the array, i can compare one WHOLE bingo card to another? Would i need to sort the results first to make the serialized arrays the same?
Thanks
Snooble
Well, bingo cards are usually sorted so I guess it should be sorted in the array. Comparing one whole bingo card to another will work but only return true or false if they are the same, they won't return the differences between the two.
-
ok, i tried following:
just to be sure. this doesn't work.
if(isset($_POST['show'])) { $show = $_POST['show']; if(is_int($show)) { //give_cookie($show); setcookie("display", "30", time()*60*60); } }
now I tried this:
if(isset($_POST['show'])) { $show = mss($_POST['show']); if($show > 0) { give_cookie($show); } }
ok, this works perfectly now. thank you! and it should be sql injection proof too?
anyway, now I have another issue. default is 25. when I select 30. it submits the form and does it's thing, but i need to refresh the page to make it display 30 results per page.. how do change that so it displays 30 right after submitting the form?
I'm guessing that you do the cookie change after the parsing of the page. Try putting the if(isset($_POST['show'])) block before you echo out all of the items/articles/results.
[SOLVED] MySQL Query & Functions
in PHP Coding Help
Posted
Use concatenation: