Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
Javascript: function no_more_popup() { var httpRequest; if(window.XMLHttpRequest) { httpRequest = new XMLHttpRequest(); if(httpRequest.overrideMimeType) { httpRequest.overrideMimeType("text/xml"); } } else if(window.ActiveXObject) { try { httpRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { } } } if(!httpRequest) { alert("Could not save setting..."); return false; } httpRequest.onreadystatechange = function() { alertResults(httpRequest); }; httpRequest.open("GET", "http://www.example.com/no_more_popup.php", true); // <------ change this url httpRequest.send(null); } function alertResults(httpRequest) { if(httpRequest.readyState == 4) { if(httpRequest.status == 200) { alert("Setting saved. You will no longer see this popup..."); } else { alert("Could not save setting..."); } } } Then have PHP do the MySQL work in no_more_popup.php
-
I don't think you can do so, but you can use this: color: rgb(133,158,235) so you can change red green and blue. Or you could learn BASE 16 and do it with the hexadecimal representation.
-
I'm not particularly good at JavaScript, but this might do it: tags = getElementsByTagName("input"); for (var i = 0; i < tags.length; i++) { tags[i].onmouseover = "this.style.textAlign='center'; this.style.backgroundColor='#6ff'; this.style.color='#000';"; } And for another time, please refrain from using such images. They are only annoying and simply typing bump or whatever bumps them as well as an image does.
-
You can't. You'll have to rely on some sort of scripting to wrap it. For example if it is a forum post like here you could have PHP wrap long words for you.
-
SELECT *, UCASE(SUBSTR(gamename,0,1)) as first_letter FROM games ORDER BY gamename;
-
Agreed. The first thing I thought about when seeing that bar was some sort of browser notice. It makes me skip that part of the screen and it actually took me a while to realize that it was part of the site's content. Also, I don't know why, but the news on the right side does in some sort look like ads to me, giving the same result as above - not looking at it.
-
IMO there is a too big gap between the top of the page and the logo. Besides, you don't even seem to have created it, so why do you ask for critique of it?
-
Looks pretty good. Try to remove the gap between the page top and the logo bar.
-
I get a 404 error...
-
Another option might be flatfile databases such as an XML file. It doesn't require anything else than a parser.
-
PayPal has a developer central here: https://developer.paypal.com/ It has a sandbox where you can test your code and access to integration documentations as well. It shouldn't be too difficult to implement - you could use CURL or sockets to connect to PayPal.
-
Like this?: <style type="text/css"> body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 80%; } #nav { list-style-type: none; display: block; padding: 0; width: 100px; } #nav a { text-decoration: none; color: green; font-weight: bold; display: block; } #nav > li { margin-bottom: 5px; border-bottom: 1px solid #AAA; } #nav a:hover { color: white; background: green; } </style> <ul id="nav"> <li><a href='#'>Link 1</a></li> <li><a href='#'>Link 2</a></li> <li><a href='#'>Link 3</a></li> <li><a href='#'>Link 4</a></li> <li><a href='#'>Link 5</a></li> </ul>
-
May not be particularly efficient, but here is an example: <?php $num_seats = 10; $arr = array('A','B','C','D','E','F'); echo <<<EOF <h1>Select seats</h1> <table> <tr> <th> </th> EOF; foreach($arr as $arr2) { echo <<<EOF <th>{$arr2}</th> EOF; } echo <<<EOF </tr> EOF; for($i=1; $i<=$num_seats; $i++) { echo <<<EOF <tr> <th>{$i}</th> EOF; foreach($arr as $arr2) { echo <<<EOF <td><input type="checkbox" name="seat[{$i}][{$arr2}]" /></td> EOF; } echo <<<EOF </tr> EOF; } echo <<<EOF </table> EOF; ?> Generated code: <h1>Select seats</h1> <table> <tr> <th> </th> <th>A</th> <th>B</th> <th>C</th> <th>D</th> <th>E</th> <th>F</th> </tr> <tr> <th>1</th> <td><input type="checkbox" name="seat[1][A]" /></td> <td><input type="checkbox" name="seat[1][b]" /></td> <td><input type="checkbox" name="seat[1][C]" /></td> <td><input type="checkbox" name="seat[1][D]" /></td> <td><input type="checkbox" name="seat[1][E]" /></td> <td><input type="checkbox" name="seat[1][F]" /></td> </tr> <tr> <th>2</th> <td><input type="checkbox" name="seat[2][A]" /></td> <td><input type="checkbox" name="seat[2][b]" /></td> <td><input type="checkbox" name="seat[2][C]" /></td> <td><input type="checkbox" name="seat[2][D]" /></td> <td><input type="checkbox" name="seat[2][E]" /></td> <td><input type="checkbox" name="seat[2][F]" /></td> </tr> <tr> <th>3</th> <td><input type="checkbox" name="seat[3][A]" /></td> <td><input type="checkbox" name="seat[3][b]" /></td> <td><input type="checkbox" name="seat[3][C]" /></td> <td><input type="checkbox" name="seat[3][D]" /></td> <td><input type="checkbox" name="seat[3][E]" /></td> <td><input type="checkbox" name="seat[3][F]" /></td> </tr> <tr> <th>4</th> <td><input type="checkbox" name="seat[4][A]" /></td> <td><input type="checkbox" name="seat[4][b]" /></td> <td><input type="checkbox" name="seat[4][C]" /></td> <td><input type="checkbox" name="seat[4][D]" /></td> <td><input type="checkbox" name="seat[4][E]" /></td> <td><input type="checkbox" name="seat[4][F]" /></td> </tr> <tr> <th>5</th> <td><input type="checkbox" name="seat[5][A]" /></td> <td><input type="checkbox" name="seat[5][b]" /></td> <td><input type="checkbox" name="seat[5][C]" /></td> <td><input type="checkbox" name="seat[5][D]" /></td> <td><input type="checkbox" name="seat[5][E]" /></td> <td><input type="checkbox" name="seat[5][F]" /></td> </tr> <tr> <th>6</th> <td><input type="checkbox" name="seat[6][A]" /></td> <td><input type="checkbox" name="seat[6][b]" /></td> <td><input type="checkbox" name="seat[6][C]" /></td> <td><input type="checkbox" name="seat[6][D]" /></td> <td><input type="checkbox" name="seat[6][E]" /></td> <td><input type="checkbox" name="seat[6][F]" /></td> </tr> <tr> <th>7</th> <td><input type="checkbox" name="seat[7][A]" /></td> <td><input type="checkbox" name="seat[7][b]" /></td> <td><input type="checkbox" name="seat[7][C]" /></td> <td><input type="checkbox" name="seat[7][D]" /></td> <td><input type="checkbox" name="seat[7][E]" /></td> <td><input type="checkbox" name="seat[7][F]" /></td> </tr> <tr> <th>8</th> <td><input type="checkbox" name="seat[8][A]" /></td> <td><input type="checkbox" name="seat[8][b]" /></td> <td><input type="checkbox" name="seat[8][C]" /></td> <td><input type="checkbox" name="seat[8][D]" /></td> <td><input type="checkbox" name="seat[8][E]" /></td> <td><input type="checkbox" name="seat[8][F]" /></td> </tr> <tr> <th>9</th> <td><input type="checkbox" name="seat[9][A]" /></td> <td><input type="checkbox" name="seat[9][b]" /></td> <td><input type="checkbox" name="seat[9][C]" /></td> <td><input type="checkbox" name="seat[9][D]" /></td> <td><input type="checkbox" name="seat[9][E]" /></td> <td><input type="checkbox" name="seat[9][F]" /></td> </tr> <tr> <th>10</th> <td><input type="checkbox" name="seat[10][A]" /></td> <td><input type="checkbox" name="seat[10][b]" /></td> <td><input type="checkbox" name="seat[10][C]" /></td> <td><input type="checkbox" name="seat[10][D]" /></td> <td><input type="checkbox" name="seat[10][E]" /></td> <td><input type="checkbox" name="seat[10][F]" /></td> </tr> </table>
-
Note that "true"[tt] is a string whereas [tt]true is a boolean. Your code snippet may result in unexpected behavior. Whether your code is secure depends what rules you have for setting it to true.
-
Isn't it just a lot of drop downs? Just search if there are any things in the database that match the things the user chose.
-
I don't think you get what he means. If you supply the word "house", then a computer (or a human) wouldn't know whether it was a noun or an adjective as it can be both. Humans only require a context to put it in, but it might be a little harder for a computer (or the person programming the script/program). Take a look here for instance: http://dictionary.reference.com/search?q=house
-
MAC addresses are as little reliable as IP addresses are. They can be spoofed as well.
-
Yeah, but if you have an object you use a lot (e.g. $db), then it might be annoying to pass $db to a lot of functions, in that case global might be better.
-
You could search here: http://www.free-webhosts.com/power-search.php
-
Making a script/program that can place words into different classes would be very complex, especially, as obsidian said, as some words can be a different word class depending on how you use them. In order of your script to understand the sentence, and thereby distinguish the ten word classes (interjections, numerals, conjunctions, prepositions, adverbs, verbs, pronouns, articles, nouns, adjectives), it would need some artificial intelligence and it would need to know how word morphology works (perhaps knowledge of its syntax would help as well?). There are people who work with nothing else than morphology. Languages are rather complex.
-
There are several tutorials here teaching how to make membership/login systems: http://www.phpfreaks.com/tutorials.php
-
A topic with trouble hosts that is pinned (like this one is for recommended hosts) in some forum would probably be more appropriate than dedicating an entire forum for bad hosts.
-
You could also make the variables global inside the function, then it would, well, do it globally instead of internally inside the function. Example: <?php $var = "hi"; function change_variable($new) { global $var; $var = $new; // or $_GLOBALS['var'] = $new } change_variable("hello"); // $var now holds the value "hello" ?>
-
str_replace('<?','<?php',$string); perhaps? I don't really see what base64 encoding has to do with changing <? to <?php...
-
Can someone Explain to me how people do this?
Daniel0 replied to stangn99's topic in PHP Coding Help
Well, if you'd like to know whether they use a CMS or coded their own system, then you'd probably be better off with asking them instead of us. We can't really help you with creating a layout that looks like theirs for two reasons: 1. If you want it to look exactly like theirs, then you'd steal their stuff and I don't think many people here would help you to do that. 2. If you want it to look like theirs in terms of their position of elements, then we probably can't help you as you would be the only one who would know exactly how you wanted it. We could give suggestions after you've made your first attempts on how to improve it though. For the programming of the backend. You would need to find out what features you want. Then you should start planning how you would implement them. For a tutorial site you would of course need a table that holds the tutorials, you would probably also need some sort of table containing the different categories and perhaps some users too.