sDJh 39 Posting Whiz in Training

1) You better don't do it this way. Write a JS-function popup with an argument. THen popup the argument (which is window.open() by the way).
2) in every link you pass the complete url from PHP to JS with simply something like this:

<a href="javascript:newwin('<?echo $row['url']?>');">

3) for the future: ALWAYS explain the error. Noone here has enough time to doublecheck your code. You problem can be either in JS, PHP, MySQL or just because your browser doesn't execute JS. So always give at least an errormessage so that we know where to look at.

sDJh 39 Posting Whiz in Training

sure you can - at least with a few downsides.
Make a pop-up-window with Javascript that loads a PHP-file. In this PHP file you can programme a very basic color-picker with the main colurs (eg in steps of 32). When clicking a box you can return the selected colour with JavaScript again.
This cannot replace a good JS or Java-app but does its work well, when you don't expect too much.

sDJh 39 Posting Whiz in Training

Of course you get. X_VALUE is printed as ASCII-Character. You have to write a procedure to convert numbers to strings. Converting them to hex is quite simple. Just have a look out in the net.

sDJh 39 Posting Whiz in Training

Guess it takes PHP so long to fetch the data from the file. Try to put the function file_get_contents() after the header-modification.
Don't know if thats the problem but tell me anyway if it worked or not.

sDJh 39 Posting Whiz in Training
<input type=file>

is the HTML-Tag for requesting a file. Note that you have to tag the form with

enctype="multipart/form-data">
sDJh 39 Posting Whiz in Training

you can simply access the current day with the date-function. I think it's date("D") for the name of the day. As today is sunday you now that the 20th was monday, 27th is the next monday and so on.

sDJh 39 Posting Whiz in Training

Two possibilities:
1. (easier) - create a site for each student each
make a list of all students and link them to a to a page where detailed information about the student are given. Now you can use dropdowns for the admin to change stuff.
2. (trickier) - list all students editable on the main page
list all students and make dropdowns for their information. In this case you have to enumerate the dropdowns through as an array. eg:

for($x=0;$x<count($result);$x++){
echo "<select name=\"course[".$x."]\"></select>";
}

When sending the data via POST, you have to go through the array and save the data in the database. It can be a bit fussy to reassociate each index with the person.

Now how to access data from dropdown?
- put dropdowns between <post> and </post>
- name them! eg

<select name="course">

- give all items a value" eg

<option value="first grade">First Grade</option><option value="second grade">Second Grade</option>

- you can now access the data in PHP like this:

echo $course;

which will output "first grade" or "second grade" depending on which option the user has selected.

sDJh 39 Posting Whiz in Training

yes and no.

on the one hand you could actually rewrite everything from the scratch (driver for harddisks, basic graficcardoperations etc) - BIOS is also written in ASM. This is possible of course but will take you ages. So you better use the BIOS-interrupts.

Linux and Win use also mainly BIOS. Textoutput, harddrives, video output, etc. Some stuff is laterly rewritten (eg WinNT/Linux: text output) to replace certain BIOS-functions. But that doesn't make sense for us as hobby-programmers as BIOS is a very, very stable library that you can use for free. So why not using it?

sDJh 39 Posting Whiz in Training

The very easiest way would be to allow only registered users to vote (as it is done at youtube, amazon, and also here).

If you don't want the visitor to sign-up you can do it with a cookie, but you must be aware that not everybody is accepting cookies and many people regulary delete them.
You could also do it as you said with saving the IP-address in a database. But as soon as the user relogins to the internet it has a totally new IP. Some might even use programmes that changes their IP-address every few seconds.

When you decide for one of the two latest ideas you cannot guarantee that a user doesn't vote more than once an hour. But therefore you can leave out a registration which might be unattractive for many users. If users have to sign up anyway when buying a product, I'd go for the very first solution.

Greetings
Simon

sDJh 39 Posting Whiz in Training

exactly the way as i told you.

on the main page you link the images (headlines, etc) to the page product.php and add the ID of that product to it (eg "product.php?id=".$id).
The page product.php now selects all information about the specified product:

mysql_query("SELECT *  FROM `products` WHERE `ID`=".$id);

Thats all.

sDJh 39 Posting Whiz in Training

I guess id would be easier to simply send commands to you server via HTTP. When createing XML or any other file you have to upload and decrypt it on your webserver (which is also possible though but takes you maybe 30% more effort).

I'd start off with these ideas:
1) set up your PHP-scripts
write some code that fetches your query from VB, checks for malware and executes it.
2) write your VB-app that sends the command (via the HTTP-header) and then reads the output of your PHP-file.
3) think of any cryption or at least login so that not everybody who just found your page by chance can access your DB.

This can be a bit nasty when you're looking for little bugs (got that often enough). But go on!

sDJh 39 Posting Whiz in Training

voice and video definately cannot be solved in PHP. You need at least Flash (Actionscript) and/or (not sure) JAVA.

As you mentioned correctly, PHP is a server-side programming-language. Therefore it's not helpful when accessing the webcam or microphone of the useres computer.

sDJh 39 Posting Whiz in Training

You have to sort unread messages out with your own index. For example you save all read messages (with POP every mail as a unique ID defined by the server) in a simple text-file. When the user logges in you catch all emails from the server and compare the IDs with your thumb-file. Every ID that is not in the file is new. As soon as the user reads it you add the message ID to your thumb file.
When you use your own messaging-system (eg forum, etc) you can simply add a flag as darkagn proposed. That can save you much trouble.

sDJh 39 Posting Whiz in Training

0) Preperation:
Give all items a unique ID or name.
1) Index-Page
Ouput all items and link then to the product-page with their ID

echo "<a href=\"product.php?item=".$row["ID"]."\">".$row["Title"]."</a>";

2) Programme the product-page:
Output more detailed information about the seleted product

mysql_query("SELECT *  FROM `products` WHERE `ID`=".$item);

Have a look at other threats here to see how to check if the variable $item isn't corrupted.

sDJh 39 Posting Whiz in Training

Wrong forum! How naive has someone to be to ask in a serious forum how to programme malware?

sDJh 39 Posting Whiz in Training

Why shouldn't you be able to use more than one query in a php-file?

When I got you problem correctyl you want to save the selected dropdown as a flag in the table

mysql_query("UPDATE `cab_eticket_numbers` SET `cab_eticket_used`=1 WHERE `number`=".$yourphpvariable);

and secondly you want to hide it the second time:

mysql_query("SELECT *  FROM `cab_eticket_numbers` WHERE `cab_eticket_used`=0");

I hope I got you right.

sDJh 39 Posting Whiz in Training

So do you have 3 buttons "A", "B" and "AB" or do you have a form with checkboxes so that the user can choose which options he(she want's to perform?

First of all I'd work with functions. Try something like:

funciton buttonA(){
//perform stuff for button A
}
funciton buttonB(){
//perform stuff for button B
}

This makes it much easier in later days to change little things in your code (bugs, updates etc).

Then you basically check which button is clicked/checked and depending on it you execute your written function.

if($buttonA=="checked")buttonA();
if($buttonB=="checked")buttonB();
if($buttonAB=="checked"){buttonA();buttonB();}
sDJh 39 Posting Whiz in Training

seems to me as if you have an empty line at the beginning of your code. Make sure that the php-tag "<?" starts directly at the beginning of your file, that all code that you include before don't echo anything and no echo or print is used in your file before your start your session. In this case it really seems to be a line break at the beginning of the file.

scru commented: That is correct +3
sDJh 39 Posting Whiz in Training

I can agree on that. Basically every computer can get a virus (which is nothing else than a normal programme). Theoretically you can crash your computer by installing good software (Photoshop, Cinema, iLife, etc). But who buys viruses on CD? You can get them only within spam-mails or unserious server. With normal respect and healthy distance to programmes that you don't know you shouldn't get in trouble.

Any changes on the Mac OS environment has to be accepted by the user with the admin-password. Application cannot be started on its own by simply loading them in you browser cache (as it works in Outlook an IE for some very strange reasons). So as long as you don't loin as admin or simply install everything you find in a spam-email there shouldn't be a problem with your system at all.

In my opinion MacOS is the most stable and save OS that is currently available. The problems it had in version 7&8 are totaly banned. Apple has the quickest Update-Service (Linux unfortunately the poorest one). So as soom as a problem is reported the work on a patch begins - in normal case you shouldn't even get in touch with the bug at all.

Greetings
Simon

sDJh 39 Posting Whiz in Training

Than you can't use DX or CX for indexing. Use ESI or EDI instead.

sDJh 39 Posting Whiz in Training

when including source to your project the assembler's root directory is the directory of your project. So you have two or actually three choices:
1) Leave the author's libs somewhere on your HD and include them with the complete path (eg "/home/yourname/authorsname/lib/whatiwant.asm"). which is a hell a lot of work.
2) always copy the lib into the folder of your project and include them with "./whatiwant.asm". Which is also stupid, because when you change a lib, you have to copy the new file to all other projects.
3) most elegant in my opinion: create a folder in the directory of all your projects and call it "lib" or "system" or whatever you want and put the stuff in there. Then you can include it via "../lib/wahteveriwant.asm" from all your projects. Changin the file then automatically affects all other projects.

Greetings
Simon

sDJh 39 Posting Whiz in Training

I forgot to increase EDX. Just add

INC EDX

at the end of the loop.

If this doesn't help then try to explain the bug in more detail or write me a PM.

sDJh 39 Posting Whiz in Training

What OS are you using? I'm not sure if that stuff is still working under NT (Win 2000 or higher). Than you have to link it directly to an exe (with Link) and execute it.
If so than have a look at the BIOS-interrupt INT 13h (http://www.ctyme.com/rbrown.htm - bookmark this site it's very, very, very important and Ralf Brown is your God!). Int 13h can also be used in the oder DOS-Versions so you bet use that in the future.

By the way: I also startet with Jeff Duntemans Book "Assenbly Language Step by Step" and I can guarantee you that this book is one of the best to start assembling. So keep going!

Greetings
Simon

PS I think that INT13h is also covered in that book a few chapters a head. Have a look there.

sDJh 39 Posting Whiz in Training

I never work width EOD but a common problem is (which causes a lot of confusion) that you have to dequote you variables. Try to change your code to something like this:

var$="This is my var ".$my_var." at line 1";

If this isn't enough than have a look if the data are sent correctly. Simply output them with an echo. If they are not set than you already have an error in your form.

Greetings
Simon

sDJh 39 Posting Whiz in Training

Change the method in the form-tag to "get". This adds the value and the variablename automatically to the URL you set in "action".
Example:

<form method="get" action="redirect.php">
<input type=text name="e"></input>
<input type=submit>
</form>

is automatically changed to redirect.php?e=enteredemailaddress

Greetings
Simon

sDJh 39 Posting Whiz in Training

Thanks indeed. I guess that couldt had been the problem. In the net I've seen a solution that uses SetFile, but it seems to be enough to simpy set the permission to +x.

Thank you, you helped me a lot!

sDJh 39 Posting Whiz in Training

Hello everybody,

I hope this is the right forum to post my question. It's a bit "in-between".

I am about to write an updater for a programme of mine. The updater downloads an update-file from my server that has packed all files I want to replace and executes a simple script.
Now all works file apart from the executable (programme.app/Contents/MacOS/programme), that MacOS doesn't accept as a binary file: it says its plain text.
What can I do in this case? How can I set the type of that file so that it becomes a normal executable? (How) Can I use the programme /Developer/Tools/SetFileType?

Many thanks in advance
Simon

sDJh 39 Posting Whiz in Training

If the game's using TCP/IP or UDP for LAN/Internet-connection then it's not a problem at all to combine multiple platforms and consoles. Even the code has not to be different. The only fuss would be to implement TCP/UDP on all platforms and that is definately differnet when accessing the OS-specific functions.

sDJh 39 Posting Whiz in Training

I hope I got it as well, but I'll give it a try:
When dividing a number with DIV then it returns the result in AX and the modulo in DX.

Communicating with a microchip can easily be done via the RS-232 (COM) Port. Have a look in you OS-environment to find the port you want to use. Alternatively you can have a look in the net as mostly the ports have the same address. There is a way, and not even hard, to find the 232-port in assembly but I can find the website in the moment and don't have my source-code on this computer. Sorry.

sDJh 39 Posting Whiz in Training
XOR EDX,EDX
MOV ECX,length
reverse_loop:
MOV AL,[string_remarks+EDX]
MOV [string_reverse+ECX],AL
LOOP reverse_loop

I'm pretty sure that's what you mean. If you have probs with you memory then try length-1 in EDX or increase ECX or something like that. If it's not working at all than ask again an I'll try my code at home.

Greetings
Simon

sDJh 39 Posting Whiz in Training

as simple as this:

<?
//Getting the current day:
$today=date("d");

//String for the dropdown...
$dropstring="<select>";
for($x=1;$x<=31;$x++){
$c="";
if($x==$today)$c=" selected";
$dropstring.="<option value=\"".$x."\"".$c.">".$x."</option>";
}
$dropstring.="</select>";
echo $dropstring;
?>

This should work, even though I haven't tested. If you find an error it must be something like missing ; or bracket. If it's not working properly please ask again^^.

Greetings
Simon

sDJh 39 Posting Whiz in Training

code 1 (The HTML-Form):

<form action="code_2.php" method=post>
<select name="phonenumber">
<option>Nb1</option>
<option>Nb2</option>
...
</select>
<input type=submit>
</form>

Code 2 (Selecting the Values in PHP):

<?
$phonenumber=$_REQUEST["phonenumber"];
$res=mysql_query("SELECT *  FROM `table` WHERE `PhoneNumber`='".$phonenumber);
?>
sDJh 39 Posting Whiz in Training

It means that you didn't open your DB correctly. I can't tell you exactly as you haven't posted the code which calls the function db_getrows(). Have a look there and make sure that the handle you're passing the function s correct.

sDJh 39 Posting Whiz in Training

get this book from amazon.com. It's really worth it. I learned assembly with it as well: http://www.amazon.com/Assembly-Language-Step-step-Programming/dp/0471375233/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1216222573&sr=8-1

nasm is my assembler of choice. It's free, fast, efficient and widespread on all OS so that you always find people who are familiar with it. YOu can find it here: http://nasm.sourceforge.net/

Quite a few IDEs can be used. Just have a look at google and decide which one you like most.

sDJh 39 Posting Whiz in Training

okay.
you have to export the offsets of each var. You can do it with a macro (does NASM hav a direct way to do so?) that does basically:
-> get called at the top of the file with the pointer to the var parsed
-> just saves 4Bytes for the Pointer

You can then write a function in C that reads the vector-table and accesses the data.

sDJh 39 Posting Whiz in Training

It does depend on the server you are using. I don't know if you can access gmail or hotmail but if you have a server running it should work. At least with my provider.

sDJh 39 Posting Whiz in Training

Just put the file favicon.ico in the directory of that file.

sDJh 39 Posting Whiz in Training

?????
I don't get your problem. You say you get an error, when you upload more than 1MB and write in your code

if ($_POST['MAX_FILE_SIZE'] >= $_FILES['file']['size']) {

By the way: hidden textboxes are bad style anyway. Why don't you just define the maximal size directly in addphoto.php?

sDJh 39 Posting Whiz in Training

I have a mini and honestly it is just amazingly... well smart.
And no: There aren't any probs with it. It is very, very silent (the first time I started it I didn't even realize that it was running =)). When you cover it (which is a stupid idea by electrical devices anyhow) and use an application that consumes a lot of CPU (eg Cinema4D) than it does get a bit louder and warmer. I never experienced a problem so far but I don't wanna push my luck.

I'm very, very happy with it and I will never give it away.

sDJh 39 Posting Whiz in Training

Login works as follows (alread typed that stuff already but someone interrupted my - damn it).

- HTML form with name and password
- PHP:

$nick=$_REQUEST["nick"];
$pw=$_REQUEST["pw"];
setcookie("nick",$nick);
setcookie("pw",$pw);

-the next pages tries to get the cookie:

$nick=$HTTP_COOKIE_VARS["nick"];
$pw=$HTTP_COOKIE_VARS["pw"];

this is very, very basic. You better use SESSION so that data are not transfered uncrypted over the internt.

sDJh 39 Posting Whiz in Training

http://www.oracle.com/technology/tech/php/index.html

Download the source/bin and recompile your php (maybe even your apache). Should work then - but don't ask me how to access it the database. Guess it works much different to mysql.

If you think it's too much work then think about exporting your oracle-DB to MySQL.

sDJh 39 Posting Whiz in Training

Nothing is missing apart from a good browser. Things about graphics in HTML (unless you messed around with tables of CSS) are nothing that you but the user have to worry about.

The problem is the following: A video is displayed by a plug-in and firefox grap the buffer from it. Now it draws the buffer to the position it has calculated by the HTML-file. When the user scrolls the page, the vertical position changes, but Firefox doesn't update the position of the video so that it is drawn to the same position - which seems to be wrong because the position of the text around has changed.

If it is now a problem of the plug-in or of Firefox I don't know exactly. But as I don't have any probs running Opera I strongly guess it is really a bad bug of Firefox.

sDJh 39 Posting Whiz in Training

Very simple reason: When you use mov bp,#mymsg you load the pointer to that string into bp. Use MOV BP,[#mymsg] instead. For the looping see PM.

sDJh 39 Posting Whiz in Training

ORG just leaves empty space before the assembled hex. So if you just code your stuff in NASM and then later want to place your C-code before, your can use the DOS-Funktion copy (cp in UNIX?). This function merges two files (your c-bin and your asm-bin). You don't have to bother about the length of one of the files.

sDJh 39 Posting Whiz in Training

Did you already write your bootloader? If yes, than most work is already done. You just place all the following stuff at the end of the loader, load that stuff into mem and execute it by setting CS to that point.

Displaying a string is the same as displaying a single char just in a loop. If you use C-strings with 0-termination the you loop through the string until a 0 occurs. Eg

mystring DB 'Hello world!',0
XOR BX,BX
print:
MOV AL,[mystring+BX]
JZ end
;output AL (don't know the code itm)
LOOP print
end:
sDJh 39 Posting Whiz in Training

Hi,

go to php.net and look up these two functions: date() and mktime(). The first one gets you all information that you need about a specific day and mktime creates you the unix-time-stamp that is needed for date().
When reading the documentation you should get all information you need to write a calender.
Greetings
Simon

sDJh 39 Posting Whiz in Training

Hi,

this is my personal opinion:
reading otherone scripts is the hell on earth. Before I try to understand someones logic I programmed everything myself a dozen of times.
What you could do is: Use the script that covers most of your project and then rewrite the stuff that you need from the other. Implementing to scripts that are not your own will a) take ages, b) be frustating and c) not teach you anything. And espacially the last point is important for you and your next projects.

sDJh 39 Posting Whiz in Training

some people use images as a table background ("background-image") and then put a transparent gif over it. So when the user wants to save the image he/she just saves the gif. Might work with a few but people who want to have you image just copy it from their browsers cache.

sDJh 39 Posting Whiz in Training

could you post the html-source of your browser? that may help other users to grasp the problem.
Cheers
Simon

sDJh 39 Posting Whiz in Training

Hi

1) you cannot protect your design from being copied. This is the soul of open-source (which has mainly developed the internet).
a) There are a few stupid tricks out in the web that propose to write something like "<!--End of page--!>" quite at the beginning of your page to confuse the regarder. But I can't imagine that this still works today.
b) you can "protect" images by embedding them in a table structure (with background-image) and then put a transparent gif over it. But again a silly idea and makes much more fuss to you than then to the one who wants to copy it.
c) when having JS you can put the code to external files and include it. If you want to be really mean then you let it parse via PHP. Place a variable inthe include path that is created when executing the main script. The browser then tryies to access the file with that code. Send it and then delete the var so that the use cannot get it the second tme he/she wants to get it.
Example:

main.php:
<?
$var=myrandom();
$f=fopen("./dynvar.txt","w");
fwrite($f,$var);
fclose($f);
echo "<script type="text/javascript" src=\"/youllnevergetthat.php?code=".$var."\"></script>";
?>

youllnevergetthat.php:
<?
$f=file("./dynvar.txt");
$anz=count($f);
blahblahblah(get each lines)
if($f[$x]==$var){
echo "your JS comes here";
}

2) Basically a login works the same. Get the vars from an input-form check if the user is avlid (from a text file or a database) and save a cookie if yes. Try to look here in …