Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. What variable/text do you want to saved to your database? Also how is your database setup?
  2. What was the query you used? You should also post the code you're using here.
  3. Use the expanded syntax for foreach foreach($arr as $key => $arrtest){ echo "$arrtest index number:($key)"; }
  4. You'll use the following url instead http://www.agci.org/programs/scientist_workshops_%3E_past_participants/participant_results.php?firstletter=UVW Then in participant_results.php you'll check to see if $_GET['firstletter'] equals to UVW or XYZ if its does you'll grab all names that begin with U, V, W or X, Y, Z at the same time.
  5. Then you'd use the concatenation operator $var1 = 'Hello '; $var2 = 'World'; echo $var1 . $var2; or alternatively $var3 = $var1; $var3 .= $var2; echo $var3;
  6. You'd do $var = 'your value here'; $sql = "INSERT INTO TABLE `table_name` SET `col_name`='$var'";
  7. I was in the same boat as you when I was learning regular expressions.
  8. Yes you could use that. Mine was just an example. I personally prefer to use a foreach loop when looping through arrays.
  9. As you start/end your patterns with a forward slash you must escape all forward slashes within your pattern. The pattern for your color bb code should be
  10. You could do $require_keys = array('key1', 'key2', 'key3'); $input_array = array('key1' = > 'Hello', 'key3' => 'World'); foreach($required_keys as $key) { // check that the key exists in the input array if(isset($input_array[$key])) { echo $key . ' exists'; } else { echo $key . ' DOES NOT exists'; } echo '<br />'; }
  11. You can run two HTTP servers from one box yes, provided they operate on separate ports, eg 80, 81 The problem is you'll need to use two different links on your site in order to get content from either of the two servers. eg domain.com/ retrieves content from the HTTP server running on port 80 domain.com:81/ retrieves content from the HTTP server running on port 81 I think you'll be better off using one or the other. Not both together.
  12. You say your script doesn't use short tags? Then what is this here: That is what is causing the error. Your previous server may of had a setting called short_open_tag enabled whereas your new server doesn't. Not all PHP setups have short tags enabled. Also try to avoid letting Dreamwever write code for you. The code generated by DW is messy and can cause a lot of problems when trying to debug.
  13. number_format is a function not a HTML tag! Cleaned your code up a bit <?php $display = 2; $cols = 0; echo "<table class=sample width=556 align=left"; while($fetched = mysql_fetch_array($result)) { if($cols == 0){ echo "<tr>\n"; } // put what you would like to display within each cell here "<tr>\n"; echo "<td width=378 valign=top>".$fetched['id']."<br />". "<span class=style1><strong>".$fetched['Customer']. "</strong>(<img src='" . $fetched['thumb'] . "' /> )<br />". "<span class=style1e>".$fetched['hi_lite']."</span><br />".$fetched['Phone']. "<span class=style1d>".$fetched['Description']."</span><br />". "<span class=style1d><strong>$".number_format ($fetched('price'), 2, '.', '')."</strong></span><br />". "<a href='mailto:".$fetched['email'] . "'>". $fetched['email'] . "</a><br /><a href='".$fetched['web'] . "' target='_blank'>". $fetched['web'] . "</a>"; "<br /></span></td>\n";
  14. Start your links with a forward slash eg <li><a href="/page/inicio">Inicio</li> Otherwise your browser will append the new link onto the existing url address. Starting links with a forward slash prevents this.
  15. Wrap format_number around your $fetched['price'] variable. Also why on earth are you doing "<tag>"."<another tag">".$var."</another tag">"."</tag>" It is better to do "<tag><another tag>$var</another tag></tag>"
  16. There are many guides available for how to use mod_rewrite. Here is one I used when I first got into mod_rewrite.
  17. That is due to an error on your part. header() cant be used after any form of output is sent to the browser.
  18. Sorry but what the hell are you going on about? in_array is used to see if a value is contained within an array. It wont return how many times that value is in the array. That is why the array_count_value exists.
  19. You have use a client side language for that if you want the image to change without the user refreshing the page.
  20. What's the purpose of the creating folders for each client? Are you trying to create clean urls, such as instead of a url like: domain.com/file.php?client=name you want it like domain.com/clientname If that's the case you should look into mod_rewrite instead. Apache on its own cant create folders. You'll need to use some from of server side language such as Perl or PHP etc to handle the creation of folders.
  21. I would be helpful if you we knew what error that script produces.
  22. Umm, seems mssql does have a built in escape function like mysql. You'll have to escape your quotes using addslashes instead. You may need to use stripslashes when you get data out of your mssql database. Alternatively you could convert all quotes to their HTML equivalent using htmlentities along with the ENT_QUOTES flag.
  23. $files['$filename'] should be $files[$filename]
  24. MVC is a design pattern which is normally endorsed by PHP Frameworks such as CakePHP, CodeIgnitor, Zend Framwork etc.
×
×
  • 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.