Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. [a href=\"http://www.php.net/eval\" target=\"_blank\"]http://www.php.net/eval[/a]
  2. Modify as needed: [code] <script>     function showDiv(a) {         if (a.selectedIndex == 0) {             document.getElementById('hiddendiv').style.display = "none";         } else {             document.getElementById('hiddendiv').style.display = "block";         }     } </script> <select onchange="showDiv(this)" name="select1">     <option selected value="y">Yes</option>     <option value="n">No</option> </select> <div id="hiddendiv" style="display: none;"> <select name="select2" id="select2">     <option selected value="0">0</option>     <option value="1">1</option>     <option value="2">2</option>     <option value="3">3</option>     <option value="4">4</option> </select> </div>[/code]
  3. Use ajax to communicate with the server without a page refresh. Refer to [a href=\"http://www.ajaxfreaks.com\" target=\"_blank\"]http://www.ajaxfreaks.com[/a] for some tutorials. I think that is the best way to do what you are wanting. However, if you want to communicate with an opened window: [code]var win = window.open(url);[/code] Then, manipulate the dom and variables just like you would in the current window, just put win in front... [code]win.getElementById('mydiv').style.display = "none";[/code] and so on. From the opened window, you can control the opening window using window.opener in the same manner. Do a google search and you will find a wealth of info. [a href=\"http://www.w3schools.com\" target=\"_blank\"]http://www.w3schools.com[/a] has quite a bit as well.
  4. You should read the manual. Specifically the sections on variables and $_GET variables. [a href=\"http://us2.php.net/manual/en/reserved.variables.php#reserved.variables.get\" target=\"_blank\"]http://us2.php.net/manual/en/reserved.vari...d.variables.get[/a] Essentially any variable that you pass in the url is available through the $_GET array. From there you can use it and manipulate it however you want...for a query, for deciding which page to display, etc.
  5. In your anchor tag, you have to specifiy the which frame using target="rightframe", or whatever the name of the "main" frame is.
  6. Does he have cookies enabled for IE?
  7. [code]<body> <form name="form" method="post" name="banana" action=""> <select onchange="form.bananaLB.selectedIndex=0;" name=bananaKG> <option selected value=0>0kg</option><option value=1>1kg</option><option value=2>2kg</option> <option value=3>3kg</option><option value=4>4kg</option><option value=5>5kg</option> <option value=6>6kg</option><option value=7>7kg</option><option value=8>8kg</option> <option value=9>9kg</option><option value=10>10kg</option></select> <br> <select onchange="form.bananaKG.selectedIndex=0;" name=bananaLB> <option selected value=0>0lb</option><option value=1>1lb</option><option value=2>2lb</option> <option value=3>3lb</option><option value=4>4lb</option><option value=5>5lb</option> <option value=6>6lb</option><option value=7>7lb</option><option value=8>8lb</option> <option value=9>9lb</option><option value=10>10lb</option></select> <input type="submit" name="Submit" value="Submit"> </form> </body>[/code]
  8. I've been having problems on both of the forums when file functions are put in the post. I have to put spaces inbetween, for example, f and open for it to post. Very frustrating when your trying to post and have a few f write functions in the code. I was noticing the other day, cause I thought my internet was being slow, that the code for the fourm's pages is very large. For example, if you do a save as, on the main display page for PHP Help, and check the size of the resulting .htm file and the directory containing additional files, it's almost 500k. If every page is 500k, that's a HUGE ammount of bandwidth every month. Even if you take into account cacheing on most people's browsers, that's a lot of bandwidth...probably still 200 - 250K for every page load. I don't know if bandwidth is a cost issue, but it may be worth considering.
  9. Why are you putting a $ in front of the ip on the following line? [code]$conn_id = ftp_connect($***.***.**.***);[/code]
  10. [!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']SELECT[/span] * [color=green]FROM[/color] [color=orange]tablename[/color] LIMIT 50 [!--sql2--][/div][!--sql3--]
  11. Add the following to the top of your contactform.php: [code]ini_set("error_reporting", "E_ALL"); ini_set("display_errors", "1");[/code] It should display any errors that are occuring.
  12. What are you trying to do? Cause you've programmed it to set to zero on each change: [code]onchange=form.banana.value=0; form.bananaLB.value=0;[/code]
  13. The array_key_exists is pointless, since you are looping until the count of the array is met, then it would have to exist, unless the key numbers are not linear. I would use a foreach loop: [code]foreach ($array as $element) {   if ($element != "") {     do code   } }[/code] or if you need access to the key values: [code]foreach ($array as $key => $value) {   if ($key == 7 && $value != "") {     do code   } }[/code] You could use a for loop, if you did, I would use your first or second examples, or you could also use a while loop. I just think the foreach is easiest, especially if the key values can be useful information...i.e. strings, or numbers that are not linear (linear meaning 1, 2, 3, 4 etc. Nonlinear meaning 1, 5, 7, 2, 4)
  14. You'll probably have to adjust your column names...but I think this will work: [!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']SELECT[/span] * [color=green]FROM[/color] [color=orange]f_post,[/color] f_thread [color=green]ORDER BY[/color] timep [color=green]DESC[/color] LIMIT 5 [!--sql2--][/div][!--sql3--] Instead of the SELECT *, select only the fields that you need from your tables...I don't know your column names from f_thread, but from f_post it looks like you would only need bname, msg, title, UID, author...so change the * to "f_post.bname, f_post.msg, f_post.title, f_post.UID, f_post.author" followed by the fields needed from the f_thread table, using the same "tablename.fieldname" format.
  15. Change your query to: [!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']SELECT[/span] * [color=green]FROM[/color] [color=orange]clan_matches[/color] [color=green]WHERE[/color] Member_1[color=orange]=[/color][color=red]'$Member'[/color] [color=blue]AND[/color] Member_2[color=orange]=[/color][color=red]'$Member'[/color] [color=blue]AND[/color] Member_3[color=orange]=[/color][color=red]'$Member'[/color] [color=blue]AND[/color] Member_4[color=orange]=[/color][color=red]'$Member'[/color] [!--sql2--][/div][!--sql3--]
  16. The manual very clearly states: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. [/quote] [a href=\"http://www.php.net/header\" target=\"_blank\"]http://www.php.net/header[/a]
  17. Unless I'm misunderstanding, your wanting something like: [code]$num = $row_bprofile['broker_rating']/$row_bprofile['broker_num_votes']; if ($num > 0 && $num <= .1) {   echo '<img src="10percent.jpg">'; } else if ($num > .1 && $num <= .2) {   echo '<img src="20percent.jpg">'; }   and so on.......[/code]
  18. If you want to see all of the columns for a table: [code]$query = "SHOW COLUMNS FROM tablename"; $result = mysql_query($query); $html = '     <table>         <tr>';      while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {     if ($row['Key'] == "PRI") {         $primarykey = $row['Field'];     }          $html .= "<th>" . $row['Field'] . "</th>"; } $html .= '</tr>     </table>'; echo $html;[/code]
  19. Make sure that the session save path is defined in php.ini. And make sure it exists on the file system, nd make sure that it has the proper permissions. Hopefully that will take care of it.
  20. Not necessarily...you can put it where ever you want, you just need to either pass the location as a part of the variable, or if they are all in a different sub directory, you can code it that way. Or you can store file names and locations in an array, then pass the array key as the var...kind of like an id. It doesn't have to be in the same directory.
  21. This should work, assuming that each line is only the username. [code]$filename = "path/to/file.txt"; $username = $_POST['username']; $file = file($filename); if (in_array($username, $file)) {   ...code for when the username is in the file... } else {   ...code for when the username is not in the file... }[/code]
  22. Make sure that .htm is set as a php extension for IIS or Apache, depending on what your using. Normally .php is set as a php script, and the other extensions will be treated as ordinary html (.htm, .html). Other exetention that can be set include .cfm for coldfusion, .asp for asp, and so on and so forth. Basically it's in the configuration of your server.
  23. What he means is instead of using: [code]function setuploaddir() { $this->uploaddir=$_POST['upload_dir']; }[/code] do: [code]function setuploaddir($uploaddir) { $this->uploaddir=$uploaddir; }[/code] Then call it by doing: [code]$classinstance->setuploaddir($_POST['upload_dir']);[/code]
  24. Start by reading tutorials at this site as well as the many many others available on the internet. Another excellent place to start is the php manual. Pretty much any question you could ever ask can be answered directly from the manual. [a href=\"http://www.php.net/\" target=\"_blank\"]http://www.php.net/[/a] [a href=\"http://www.php.net/manual\" target=\"_blank\"]http://www.php.net/manual[/a]
  25. [!--quoteo(post=356194:date=Mar 18 2006, 12:28 PM:name=Jonaid)--][div class=\'quotetop\']QUOTE(Jonaid @ Mar 18 2006, 12:28 PM) [snapback]356194[/snapback][/div][div class=\'quotemain\'][!--quotec--] Any way to get the actual article to just come up? [/quote] What exactly are you trying to do? RSS is XML, which your browser will format and display back...it's still XML...it hasn't been formatted as HTML or anything else...at least not at the link your provided. If your wanting to read the articles, or utilize the RSS, use a feedreader.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.