Jump to content

cedricganon

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cedricganon's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. yes it is. to give you an idea of the structure its something like this: index.php: root folder somefile.html: /dir1/dir2/somefile.html picture.jpg: /dir1/dir2/images/picture.jpg the images folder is located in the same folder as somefile.html. I've tried using a path relative to the root folder for the image ie: <img src='/dir1/dir2/images/picture.jpg'> as opposed to a path relative to somefile.html: <img src='/images/picture.jpg'> neither presents an image
  2. Hello So in my index.php code i include('somefile.html');. In the html file itself there is an <img src="/images/picture.jpg">. When looking at index.php on a browser, the html looks fine everything loaded fine except for the <img> There is a little broken image link displayed on the page. i checked through the browser if i mistyped the img src link but somefile.html in the browser displays the image fine. But if i try to display the img in the html file through the php file, its a broken link. Any reason why this is happening? Am I missing something here? Thanks in advance.
  3. Hello Everyone So i have this script that pulls some stuff out of a db and displays it. Pretty basic. It used to work fine but now it omits one entry from the table. It always shows one less than its supposed to. I.E. if there are 4 table entries, it only shows 3. It didnt do this before and I'm not sure why it changed. I didnt edit the code at all. Here it is: else{ $sql = "SELECT * FROM article WHERE lang='" . $validlang ."' AND cat_id=" . $validentry . " ORDER BY id DESC LIMIT 5"; $result = mysql_query($sql); if(!$result){ echo "Error querying the database." . mysql_error(); exit; } else{ $row = mysql_fetch_assoc($result); } if(!$row){ echo "Error: No articles found." . mysql_error(); exit; } else{ echo "<div id='section'>Organization News</div>"; while($row = mysql_fetch_assoc($result)){ echo "<h3><a href='" . $validlang . "/" . $row['location'] . "'>" . $row['title'] . "</a></h3>"; echo "<div id='subtitle'>" . $row['summary'] . "</div>"; } } } Any help would be appreciated. Thanks
  4. I gotcha. Yep stupid mistake. Thanks for help!
  5. wouldnt the isset() function be the one checking for that string or do you mean something else?
  6. heres what i noticed: $query = "select productquantity from products where productcode = '$sproductcode'"; Try this: $query = "SELECT productquantity FROM products WHERE productcode='" . $productcode . "';"; see if that helps!
  7. Hello everyone. I had another account here but it seems to have been wiped from the face of the internets. oh well. I was working on a basic form on a multilanguage website so i need it to properly acknowledge what language it is working with. the link to the page would be like so: index.php?lang=en&sb=1 so the code, as required to read it, is as follows: if(isset($_GET['lang']) == TRUE){ switch($_GET['lang']){ case 'en': case 'it': case 'pl': $validlang = $_GET['lang']; break; default: $validlang = 'en'; break; } } else{ $validlang = 0; } if(isset($_GET['sb']) == TRUE){ if(is_numeric($_GET['sb'] == FALSE)){ $error = 1; } if($error == 1){ header("Location" . $config_basedir); } else{ $validentry = $_GET['sb']; } } if($validlang == 0){ echo "An unknown error has occurred." . mysql_error(); } for whatever reason $validlang always comes out with the value 0. I even set tried setting $validlang = 'en'; before that snippet to at least force it to hold some value but I'm obviously doing something stupid here (isn't that usually the case ) that I can't seem to catch. Can anyone help clear this up for me? I really appreciate it!
×
×
  • 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.