andrewgauger
Members-
Posts
603 -
Joined
-
Last visited
Never
Everything posted by andrewgauger
-
If this is indeed a php question: mkdir("/path", 0700); Should work, and it won't "over write" an existing directory.
-
Dynamic Select without reloading the page?
andrewgauger replied to tblade's topic in Javascript Help
This seemed noob friendly: http://www.dhtmlgoodies.com/index.html?whichScript=ajax_chained_select -
<meta http-equiv="refresh" content="5;url=yourpageurl.php"> so after 5 seconds the browser will refresh. This goes between: <head> and </head>
-
http://www.php.net/manual/en/function.mail.php#97680 Try removing the /r from the $headers.
-
Any Security Concerns with REQUEST_URI
andrewgauger replied to cyberRobot's topic in PHP Coding Help
I apologize in advance if I'm wrong, but I thought that: action = "" does the same thing. -
Trying to use AJAX/jQuery, but getting a very odd error
andrewgauger replied to ShootingBlanks's topic in Javascript Help
<select name="Second_Select">' should be <select name="Second_Select" id="Second_SelectID">' in draw_second_select.php -
How did you learn php, how long did it take?
andrewgauger replied to gaogier's topic in Miscellaneous
It took me 4 days to get good at PHP. I started by reading: Professional PHP 5 from Wrox. But..... PHP was not my first language. Then again, there are those who would say that I'm not good at php *snarf* -
I know this isn't what you are asking for, but this is the route that I would have gone: http://www.pdflib.com/
-
If you want Membership[1] Membership[2] POSTed you should take out the ($list_item_key} of your echo under the name so that: <li><input type="text" id="FirstName_<?php echo $portal ?>" name="FirstName[]" /></li> <li><?php foreach(fmsValueListItems($OO_Secure,'Web_Tickets','Dietary Requirements',"") as $list_item_key=>$list_item) { if($list_item == "") { echo "<input id=\"Membership{$list_item_key}\" name=\"Membership[]\" type=\"checkbox\" value=\"{$list_item}\" checked=\"checked\">{$list_item}\n"; } else { echo "<input id=\"Membership{$list_item_key}\" name=\"Membership[]\" type=\"checkbox\" value=\"{$list_item}\">{$list_item}\n"; } } ?> </li> I think this works too: <li><input type="text" id="FirstName_<?php echo $portal ?>" name="FirstName[]" /></li> <li><?php foreach(fmsValueListItems($OO_Secure,'Web_Tickets','Dietary Requirements',"") as $list_item_key=>$list_item) { if($list_item == "") { echo "<input id=\"Membership{$list_item_key}\" name=\"Membership[{$list_item_key}]\" type=\"checkbox\" value=\"{$list_item}\" checked=\"checked\">{$list_item}\n"; } else { echo "<input id=\"Membership{$list_item_key}\" name=\"Membership[{$list_item_key}]\" type=\"checkbox\" value=\"{$list_item}\">{$list_item}\n"; } } ?> </li>
-
Nope. Unless you rewrite your apache (assuming your httpd is apache) to link .htm extensions to the php engine. It is just safer to call use the .php extension and write your html in there natively. Remember anywhere you don't have: <?php ?> Is treated like regular html so... <html> <head> <title>Webpage</title> </head> <body> <?php echo "Hello World"; ?> </body> </html> Is perfectly legitimate.
-
-
Yeah, build a different query, and look into handling (in javascript) onChange for the select.
-
XML was first, and that is why I quote as best practice. I do not support it as the best product.
-
SELECT a.threadID, count(*) FROM posts as a JOIN comments as b ON (b.threadID = a.threadID) GROUP BY count(*)
-
With your topic title being "best practice" I would advise XML. However, JSON is generally easier to parse. http://www.php.net/manual/en/function.json-decode.php Makes it pretty easy to use.
-
Alternate Versions of the IF Statement
andrewgauger replied to cyberRobot's topic in PHP Coding Help
in_array is one way: $isin=array("Regular", "Student", "Retired); if(!in_array($memType, $isin)){ //invalid! } -
http://dev.mysql.com/doc/refman/5.0/en/order-by-optimization.html I hope you can find the answer here, because I do not understand indexing very well.
-
Reaching around my head to scratch my nose?
andrewgauger replied to sharp.mac's topic in PHP Coding Help
back-ticks (the ~ without a shift) is the appropriate way to mitigate field names that contradict reserved work (such as "group" or "interval", and "password" is debated). My opinion is to not use reserved words AND to use back ticks. That said, no you are not doing this according to "industry standard" practices. Your table should look like this: cities city_id city 1 Bradenton 2 Cocoa Beach And have a table that defines references connects city_id connect_id 1 9 1 11 2 11 3 11 Your solution does not scale well. This may work for your implementation, but next project create a referential table You then use join in your select syntax to return multiple rows for each reference. SELECT a.`cities` FROM `cities` as a JOIN `connects`as b ON (a.`city_id`=b.`connect_id`) WHERE a.`id` = " . $row['id'] Will return city names that connect given the id of the original city. @mjdamato nailed it. -
Ok, so here's what is up. You will need to assemble an array while you loop through your while($parts=fget...) <html> <head> </head> <body bgcolor=#E2E965 link=black vlink=black alink=black text=#D5DF23> <style type="text/css"> #nav, #nav ul { padding: 0; margin: 0; list-style: none; } #nav li { float: left; width: 120px; } #nav ul { position: absolute; width: 120px; left: -1000px; } #nav li:hover ul { left: auto; } <!-- a {text-decoration:none} //--> body { scrollbar-arrow-color: #E2E965; scrollbar-face-color: #D7182A; scrollbar-highlight-color: #000000; scrollbar-3dlight-color: #D6DF23; scrollbar-shadow-color: #00000; scrollbar-darkshadow-color: #00000; scrollbar-track-color: #D6DF23; } input:link {text-decoration: none; color: #E2E965;} input:visited {text-decoration: none; color: #E2E965;} input:active {text-decoration: none; color: #E2E965;} .spacer_black { margin: 0px; padding: 0px; border: 5px; height: 2px; width: 100%; line-height: 0px; font-size: 0px; background-color: #000000;} </style> <table width=800 border=0><td> </html> <?PHP $offset = isset($_GET['offset'])?$_GET['offset']:0; $LinesToDisplay = 12; $row = $offset + $LinesToDisplay; $row2 = $offset - $LinesToDisplay; $file_handle = fopen("web.txt", "rb"); error_reporting( E_ALL ); // DEBUGGING $SelectArray=new array(); while ((($parts = fgetcsv($file_handle,4096,"|")) !== FALSE) && ($LinesToDisplay > 0) && (!feof($file_handle))) { //new code //skip first $offset lines $num = count($parts[6]); $SelectArray[]=$parts[6]; if ($parts[5] == 9999) { if ($offset-- > 0) {continue;} $parts[0] = ucwords(strtolower($parts[0])); $parts[1] = ucwords(strtolower($parts[1])); ?> <td> <?php echo "<table BACKGROUND='background.jpg' border=0 width=250><td width='243' height='105'>"; echo "<font size=-1 face='helvetica' color=#812990><b>$parts[0]</b></font>"; echo "<i>"; ?> <html> <div onMouseOver="this.style.color = 'black';" onMouseOut="this.style.color = '#D5DF23';"></html><?php echo "<font size=2>-$parts[1]</font>"; echo "</div></i>"; ?><html><a href="#" title="Koop nu de <?php echo $parts[0]; ?>" onClick="window.open('form.php?p=<?php echo urlencode($parts[0]); ?>','popuppage','width=400,height=400,top=250,left=250,resizable=0,statusbar=0,titlebar=yes,toolbar=no,scrollbars=no,location=no,directories=no');"> <div><img src='ster.jpg' border=0 width='46' align='right'></a> <a href="#"><img src='envelope.jpg' border=0 width='46' align='right'title="Heeft u een vraag over <?php echo $parts[0]; ?>" onClick="window.open('vraag.php?p=<?php echo urlencode($parts[0]); ?>','popuppage','width=400,height=400,top=250,left=250,resizable=0,statusbar=0,titlebar=yes,toolbar=no,scrollbars=no,location=no,directories=no');"> <div></a> <TABLE BORDER='0' cellpadding='0' CELLSPACING='0'> <TR> <TD WIDTH='70' HEIGHT='20' BACKGROUND='pricebackground.jpg' VALIGN='bottom'> <center> <font size=2 color=white face='helvetica'> <b></html> <?php echo "€ $parts[2]"; ?> </b> </td> </tr> </table> <?php echo "<b><font size=3 color=#D7182A>Op Voorraad In:<br></font>"; echo ("<font color=black> Amsterdam </font>"); if ( $parts[3] >= 1 ) echo ("<IMG SRC =green.gif>").""; if ( $parts[3] <= 0 ) echo ("<IMG SRC =red.gif>").""; echo ("<font color=black> Utrecht </font>"); if ( $parts[4] >= 1 ) echo ("<IMG SRC =green.gif>")."</td></table></b><p style='margin:9px;'>"; if ( $parts[4] <= 0 ) echo ("<IMG SRC =red.gif>")."</td></table></b><p style='margin:9px;'>"; $LinesToDisplay--; if ($LinesToDisplay/3==intval($LinesToDisplay/3)) { echo "<tr><td>"; } }} fclose($file_handle); ?> <tr align=right> <select style="background-color: #FFFFFF; color: #000000; font-family: Arial; font-weight: none; font-size: 12; width: 150px; "> <?php $i=1 foreach ($SelectArray as $val){ echo "<option value=\"$i\">$val</option>\n"; $i++; } ?> </select> <font color=black><body alink=black vlink=black link=black text=black> <center><a href="occasiona.php?offset=<?php echo $row2;?>" align=center>« previous</a> || <a href="occasiona.php?offset=<?php echo $row;?>">next »</a></table></html> Also you are using the <html> tag incorrectly.
-
Result depending on the incomming value of array
andrewgauger replied to gladz0r's topic in Third Party Scripts
I was in the process of modifying your code, but I think you made a mistake with your post because the conditional you requested would evaluate and then display the same for either case. Your code provided is identical to the code in the sample. Also--I visited your site and noticed the behavior you were requesting. There were some media options that had no images. Has this been resolved? -
Scope of an (un)global. duh..... Guess I am getting sloppy.
-
The table is ordered from the beginning. That order never changes. The first entry you put in the table is the first entry in your table. When you use ORDER BY you are starting from the top of the table and returning the values that are grouped by the order. The only other reason for this behavior would be a shoddy index. Please post this result: SHOW INDEX FROM `lunapr_custom_grid`
-
Help me. Validating form then updating mysql , whats wrong here.
andrewgauger replied to mrcoda's topic in MySQL Help
else if -> elseif no space -
put this after <?php towards the top ini_set('display_errors', 1);