Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. You can found what those represent by running the following script: for($i = 90; $i < 100; $i++) { echo "%$i = " . urldecode("%$i").'<br />'; } Outputs
  2. We are using SMF2 beta 4. We're not the creators of this forum. You should report any bugs to the developers of SMF. Hopefully all issues posted here should be resolved once SMF2 final is released.
  3. auto-margins work fine in IE6+. I have never used text-align to align block level elements. WIth IE you need to have a valid DOCTYPE present. Without a doctype IE will render your page incorrectly as its in quirks mode.
  4. That path is fine. If you changed the \\ to \ you may exprience strange results/errors.
  5. To center align block level element such as a div you should use auto-margins Example div { width: 80%; /* You must specify a width in order for auto-margins to work; */ margin: 0 auto; /* Center align the div */ } Never use text-align to center align block level elements, it will only affect the text within the element and not where it positions on the page.
  6. You can use .html files as the view yes. Just specify the .html extension when loading a view. eg $this->load->view('filename.html'); If you dont specify a file extension CI will append the .php
  7. Use file() then count()
  8. Are ok now I see whats up. Use RewriteEngine On RewriteBase /Property-Agent RewriteRule ^Home index.php [NC,L] RewriteRule ^News news.php [NC,L] RewriteRule ^Search search.php [NC,L]
  9. Where is your .htaccess file located? Post the full path here.
  10. You save all your websites files etc in Apaches /htdocs folder. Apache can be configured to serve files from a different folder if so you wish to by changing the DocumentRoot
  11. Umm, instresting. Use RewriteEngine On RewriteBase / RewriteRule ^Home /Property-Agent/index.php [NC,L] RewriteRule ^News /Property-Agent/news.php [NC,L] RewriteRule ^Search /Property-Agent/search.php [NC,L]
  12. Yes you'll need to define the path to the file the rewrite rule applies to. EDIT: Or you could just move the .htaccess file in to your '/Folder Name' folder
  13. This is code from a tutorial from phpit.com. How the code works is explained here In order to understand the code you should at least have a thorough understanding of the PHP syntax (such as variables, data types, control structures, operators etc). Aswell as basic Object Oriented Programming knowledge.
  14. The problems you're facing is to do with register_globals register globals has since been disabled as of PHP4.3 and is to be removed completely in the upcoming PHP6 release. register globals can cause security exploits within your code and you should update your existing scripts so they do not rely on register_globals. I also strongly urge you to upgrade your current versions of PHP4 to PHP5. PHP4 is no longer supported.
  15. Well there are a few problems with that code. The first $con = 'INSERT INTO `accounts` (username, name, password, email, dob) VALUES ("' . $user . '", "' . $name . '", "' . $pass . '", "' . $email . '", "' . $dob . '")'; $accountid = mysql_query($account['accountid']); $account = "SELECT * FROM `accounts` WHERE `accountid` = '$accountid'"; mysql_query returns a result resource and nothing else. result resources cannot be used within queries. In order to get the data returned from a query you'll need to use one of the following functions: mysql_fetch_(array, assoc or row) or mysql_result You should use the following code. // define the query for inserting a new account $sql = 'INSERT INTO `accounts` (username, name, password, email, dob) VALUES '. '("' . $user . '", "' . $name . '", "' . $pass . '", "' . $email . '", "' . $dob . '")'; // create a new account $result = mysql_query($sql); // check that the query executed successfully if($result) { // now that a new account has been added we'll retrieve the accountid $accountid = mysql_insert_id(); // if you're not sure what this function does go to http://php.net/mysql_insert_id // now create a new profile $sql = 'INSERT INTO `profile` (accountid, about, content, unknown) VALUES ( "'.$accountid.'","Edit me", "Edit me", "Edit me")'; $result = mysql_query($sql); if($result) { echo '<center>You have successfully created your account. You can now log in.</center>'; } // unable to create account profile, kill the script and display an error else die('Unable to create account profile!<br />MySQL Error: '.mysql_error()); } // unable to create new account kill, the script and display an error else die('Unable to create a new account!<br />MySQL Error: '.mysql_error());
  16. Can you post the full 404 error message here. My earlier code should of been RewriteEngine On RewriteBase / RewriteRule Home /index.php [NC,L]
  17. EDIT Ignore more I was replying to old post
  18. Your rewrite rule will one work if your url is site.com/Home/ If you dont want to have the ending slash then use RewriteEngine On RewriteBase / RewriteRule /Home /index.php [NC,L]
  19. Change // loop through variables to check. foreach($check_vars as $key ) { if(isset($row[$key]) && $row[$key] == 1) { $$key = 'X'; } } to // loop through variables to check. foreach($check_vars as $key ) { if($row[$key] == 1) { $row[$key] = 'X'; } $$key = $row[$key]; }
  20. Thats what my code does. The following code takes care of that // loop through variables to check. foreach($check_vars as $key ) { if(isset($row[$key]) && $row[$key] == 1) { $$key = 'X'; } }
  21. An article on mod_rewrite
  22. I don't know. It was in your code originally. This is the syntax for variable variable's
  23. // list vars to check $check_vars = array('pm1', 'designer1','pm2','writer','pm3','designer2','pm4','christine','pm5','designer3','pm6','julie', 'pm7','designer4','pm8','proofreading','pm9','layne','pm10','programming','pm11','testing'); while($row = mysql_fetch_array($val_qry)) { $id = $row['id']; $project = $row['project']; $project_id = $row['project_id']; // loop through variables to check. foreach($check_vars as $key ) { if(isset($row[$key]) && $row[$key] == 1) { $$key = 'X'; } } $arr = array($id, $project, $project_id, $pm1, $designer1, $pm2, $writer, $pm3, $designer2, $pm4, $christine, $pm5, $designer3, $pm6, $julie, $pm7, $designer4, $pm8, $proofreading, $pm9, $layne, $pm10, $programming, $pm11, $testing); $excel->writeLine($val); }
  24. Adapted your code a bit. function create_nav($nav_links) { foreach($nav_links as $link) { ?> <div style="background:#FFFFFF; border:#999999 thin solid; margin-top:2px; text-align:right; width:300px"> <a href="<?php echo $link['url']; ?>"><?php echo $link['title']; ?></a> </div> <?php } } create_nav(array( array( 'title' => 'Home', 'url' => 'home.html'), array( 'title' => 'About', 'url' => 'about.html'), array( 'title' => 'Contact', 'url' => 'contact.html') ) );
  25. You'll have to use a foreach loop within a foreach loop $var = array(array('Home','index')); foreach($var as $nav) { ?> <div style="background:#FFFFFF; border:#999999 thin solid; margin-top:2px; text-align:right; width:300px"> <?php foreach($nav as $title) echo $title; ?> </div> <?php }
×
×
  • 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.