Jump to content

Aro

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Aro's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Do have any idea on the BEST way to go about that? any ideas?
  2. I have coded a database and I dont like how the user can edit the titles through the get variable. Is there anyway I could stop that? Wouldnt getting each request from the database slow down the site? <?php include "config.php"; include "functions.php"; $SITEURL = addSlash($SITEURL); $action = $_GET['action']; $state = $_GET['state']; $city = $_GET['city']; $id = $_GET['id']; echo $SITEURL; switch($action) { case 'cities': include 'templates/cities.php'; break; case 'place': include 'templates/place.php'; break; case 'places': include 'templates/places.php'; break; default: include 'templates/home.php'; break; } ?> #places.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php echo $siteTitle; ?></title> </head> <body> <h2><?php echo $SITETOPIC." in ".$city.",".getStateName($state); ?></h2> <?php $query = "SELECT DISTINCT biz_name, biz_id FROM animalshelter WHERE city = '".$city."'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<a href=http://".$SITEURL."place/".$state."/".urlencode($city)."/".$row['biz_id'].">".$row['biz_name']."</a><br />"; } ?> </body> </html> #.htaccess # .htaccess mod_rewrite # demo.com Options +FollowSymlinks Options +Indexes RewriteEngine On RewriteBase /databaseSite/ ErrorDocument 404 /templates/404.php RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^([a-zA-Z]+)/([a-zA-Z]+)$ index.php?action=$1&state=$2 [QSA,NC] RewriteRule ^([a-zA-Z]+)/([a-zA-Z]+)/([a-zA-Z\+\_\-]+)$ index.php?action=$1&state=$2&city=$3 [QSA,NC] RewriteRule ^([a-zA-Z]+)/([a-zA-Z]+)/([a-zA-Z\+\_\-]+)/([0-9]+)$ index.php?action=$1&state=$2&city=$3&id=$4 [QSA,NC]
  3. Aro

    Aro here

    Hey, this is Aro. I'm learning php and want to get involved in the community.
  4. You don't need to do any of that stuff. Make less work for yourself and just edit if from the the query. premiso has the best idea. $query = mysql_query("SELECT * FROM table_name WHERE column1 IS NOT NULL");
  5. You didn't define the column names try: $query = mysql_query("INSERT INTO table_name (column1,column2,column3) VALUES ('$var1','var2','$var3')") or die(mysql_error());
  6. When doing large projects my code seems to get all over the place. How do you guys organize your code?
  7. Aro

    Hello I'm Aro

    Hey Thanks for the welcome. Well I don't program for a job but I do build websites and understand the language. I do know a bit about other languages like C/C++ and python but I haven't mastered them I still I have to go back to the manual every then and now. And if you want to call XHTML/CSS a language, I know that.
  8. Hello I'm Aro. I am a intermediate programmer not a n00b but still learning. Hope to help and learn alot from this community
×
×
  • 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.