Jump to content

jfee1212

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jfee1212's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. the problem with that is that I am accessing the image inline with another page. [a href=\"http://www.jafsitedesign.com/collegeartstore\" target=\"_blank\"]http://www.jafsitedesign.com/collegeartstore[/a] the uploads file is ../../uploads/uploads relative to collegeartstore
  2. like I said, it is not in public_html so people can't use their own scripts to upload unwanted files to that folder. ../.. goes above the www.site.com, but it is not displaying the picture
  3. I am developing in linux and the server is also linux. The upload script works perfectly fine (after one slight modification), but I am not sure how to access the image. I tried this: [code]echo "<div align='center'><img align='center' src='../../uploads/uploads/$image_path' /></div>";[/code] where $image_path is the dynamically generated image path. The outputted code in the page is: [code]<img align='center' src='../../uploads/uploads/30.jpg' />[/code] Which looks like it should work, however it does not. (that is the right directory by the way) any help?
  4. I have made an upload script, and do the requirements of uploadin, the upload folder has write access. The problem is, I want that folder to be somewhere where it can only be uploaded to by my server. Also, (this script regards images) I need to be able to include the uploaded images in a page. I tried using relative paths.... eg [code]<img src="../../uploads/imagefilename.jpg" />[code] but that doesnt work. Any help? do I need to do an fopen on the file?
  5. instead of having: [code]  /* Display table contents */    $i=0;    while ($i < $num_rows) {    $id=mysql_result($result,$i,"ID");    $topic_name=mysql_result($result,$i,"TopicName");       if($i % 2) {         echo "<tr class=\"tabletext\">";       }       else {         echo "<tr class=\"tabletextwhite\">";       }    $i++;    }[/code] try: [code]/*Display table contents */ while($data_array = mysql_fetch_array($result, MYSQL_ASSOC)){ $id = $data_array['ID']; $topic_name = $data_array['TopicName'];            if($i % 2) {         echo "<tr class=\"tabletext\">";       }       else {         echo "<tr class=\"tabletextwhite\">";       }    echo $topic_name . "</tr>";    $i++; }[/code] I don't see where you echo $topic_name, perhaps on another script. Wherever you did, delete it, and this will print the correct variables. The MYSQL_ASSOC creates an associative array, which can be accessed using $array_name['fieldname'] In this case I named the array $data_array, but it can be called anything. Each time it passes through the while loop, it takes the next row and uses that as the row to choose fields from. Hope this helps.
  6. Make sure that the table you're selecting columns from is truley registry. if it was Registry or REGISTRY it would return false
  7. @jworisek... THANK YOU SO MUCH Its one of those things that you look back at and think "Man was I stupid". @fractill... I believe you are referring to saving the login for a different session. withh the $_SESSION variable, it is stored locally to the server and is retrieved based upon the PHPSESSID cookie.
  8. I have this code included in index.php (which is the only accessible file... it includes all of the other pages) [code]<?php session_start(); if(!$validation){     die('You do not have the proper privileges to view this page'); } $mysql_user = "XXXXX"; $mysql_password = "XXXXXX"; $mysql_server = "XXXXXX"; $mysql_db = "XXXXXX"; $connect = mysql_connect($mysql_server, $mysql_user, $mysql_password); $select = mysql_select_db($mysql_db); if($logout = true){          $_SESSION['loginid'] = NULL; } if($_POST['login']){     if($_POST['username'] && $_POST['password']){         $username = stripslashes($_POST['username']);         $password = stripslashes($_POST['password']);                  $userid = mysql_query("SELECT userid FROM users WHERE username='$username' AND password=PASSWORD('".$password."')");                  $valid = mysql_num_rows($userid);                  $login_userid = mysql_fetch_array($userid);         if($valid==1){                          $userid = $userid[0];             $_SESSION['loginid'] = $login_userid[0];                                                }else{             echo 'Incorrect login info';         }          }else{         echo 'You did not fill in the fields';     } } if(isset($_SESSION['loginid'])){     $user_loginid = $_SESSION['loginid'];     $login_get_realname = mysql_query("SELECT realname FROM users WHERE userid='$user_loginid'");     $login_get_username = mysql_query("SELECT username FROM users WHERE userid='$user_loginid'");     $user_realname = mysql_fetch_array($login_get_realname);     $user_username = mysql_fetch_array($login_get_username);     $user_realname = $user_realname[0];     $user_username = $user_username[0];                   $user_logged_in = true;               } $home = "users"; ?>[/code] I use $user_logged_in on other pages to verify that the session is there and validated, however when i echo $_SESSION['loginid'] it returns null. When you first log on, the "Welcome..." iinfo is displayed properly, but when you click on a link it loses the logged in status. The link is [a href=\"http://www.jafsitedesign.com/collegeartstore\" target=\"_blank\"]http://www.jafsitedesign.com/collegeartstore[/a] Thanks a bunch
  9. I'm sure they are, but are the included files in the same directory? try using [code]include("http://site.com/script.php");[/code]
  10. [!--quoteo(post=372987:date=May 10 2006, 01:31 PM:name=Webnerdz)--][div class=\'quotetop\']QUOTE(Webnerdz @ May 10 2006, 01:31 PM) [snapback]372987[/snapback][/div][div class=\'quotemain\'][!--quotec--] I tired to find this somewhere, but I had no luck. I am trying to find the php code to write a file then a predefined extension. As in, the user enters a file name and the script creates the file and the predefined extenstion. Right now I can create the file and contents, but the user enters the entire filename 'filename.ext'. I want them to enter 'filename' and the script create the '.php' part. Hope that makes sense. Thanks in advance for your help. [/quote] Let's say the name of the variable containing the filename is "file" [code]$file .= ".ext"[/code] this adds .ext onto the end if $file.
  11. I am making a simple PHP proxy script to allow access to sites blocked by my school's firewall. I am trying to change all relative links to absolute links so they are consistant and easier to work with. I have this code... [code]$pattern = '#href[\s]*\=[\s]*(\'|"|)(\|/|)#i'; $replace = 'href="'.$_POST['site']."/"; $html = preg_replace($pattern, $replace, $html); }[/code] However when I open google with this done, the links are still relative. Any assistance in correcting and understanding the problem is greatly appreciated. TIA -Josh
×
×
  • 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.