Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by ChayaCooper

  1. One of my topics disappeared while I was responding to a question and when an administrator tried correcting the problem they accidentally merged it with another one of my topics. The topic which disappeared was about setting the path to config.php when it's in another folder. I temporarily posted a 2nd time about this in order to respond to the members who had been in the middle of helping me (the link to the 2nd posting is http://forums.phpfreaks.com/topic/271845-correct-way-to-set-path-to-configphp-in-another-folder/ ). That was then merged with: http://forums.phpfreaks.com/topic/271838-how-do-i-get-salt-when-its-in-the-configphp-file/ Can they be unmerged? If not, can you delete the posts? It's way too confusing for anyone trying to help me figure out a solution (let alone someone who's trying to read it in the future ;-) )
  2. Did that :-) I added to the config.php echo ("test"); In 'demo folder' - debug.php <?php session_start(); error_reporting(E_ALL); require_once 'secure_folder/config.php'; ?> And when I go to http://www.click2fit.com/demo/debug.php it echos 'test' :-)
  3. Wow! Thanks for responding so quickly :-) It seems that I'm having problems with both of my postings: Correct Way To Set Path To Config.php In Another Folder How Do I Get $Salt When It's In The Config.php File? Unfortunately, the first one is still a problem :-( Can you help me with that too? I was able to access the 2nd post now with the link you sent me, but I'm still getting the error message "Sorry, we couldn't find that!" when I click on the original link sent via email, which unfortunately means that the members who are being so generous with their time and trying to help me won't be able to access it either :-(
  4. @jazzman1: Here are the results from the 3 folders: Parent Directory /home4/clickfi4/public_html 'demo' folder /home4/clickfi4/public_html/demo 'secure_folder' subfolder /home4/clickfi4/public_html/demo/secure_folder
  5. My previous post disappeared for some reason :-( Thankfully I still have the suggestions made by jazzman1 and AoTBuNgLe in my email :-) @jazzman1: Here are the results from the 3 folders: Parent Directory /home4/clickfi4/public_html 'demo' folder /home4/clickfi4/public_html/demo 'secure_folder' subfolder /home4/clickfi4/public_html/demo/secure_folder
  6. I'm assuming that you're asking where the document is located? 'secure_folder' is located inside the folder 'demo', and I need to reference it from files which are either in the 'demo' or the parent directory.
  7. What is the correct way to set the path to a file when it's in a subfolder? Adding the folder name like this didn't work require_once('secure_folder/config.php');
  8. I'll try that again :-) I thought that should be the case, but when it didn't work I figured I must be doing something wrong ;-) Just to make sure that I'm not missing something I'm declaring in config.php $salt = "XYZ"; // 10 digit string. Then if I've created a connection to config.php in the other file I can just use it like this: '".sha1($salt + $_POST['password'])."'
  9. I ended up creating an array in my php file with the images $Silhouettes = array( 'Crew_Neck' =>'files/style-Crew_Neck.png', 'Scoop_Neck' =>'files/style-Scoop_Neck.png', 'V-Neck' =>'files/style-V-Neck.png' ... ); And the array is referenced in these 2 places: foreach($Silhouettes as $cname=>$ccode) style="background-image: url('files/style-<?php echo $cname; ?>.png'); background-repeat: no-repeat; border: none;"
  10. I know this is a really basic question, but I'm still a real php noob. I want to move $salt to the config.php file, but I'm not sure how to call the variable correctly so the page can use it. I tried this: require_once('config.php); $salt = loadSaltFromConfig(); I'm assuming that I need to declare loadSaltFromConfig somewhere, but I'm not quite sure what that would need to be.
  11. The page still doesn't load :-( Should I be defining $path somewhere? This is my current code (with the corrections suggested) <?php $result = mysql_query("SELECT * FROM style WHERE style.user_id=$user_id ") or die(mysql_error()); $row = mysql_fetch_array($result ); $images = explode(',', $row['silhouettes_like']); foreach ($images as $im) { echo "<img src='$path.$im'> and ; } ?> <?php echo "<img src='files/" . $row['silhouettes_like']. ".png'>"; ?>
  12. I must be missing something, because when I added it to my code it stopped working. Is this what you meant? <?php $result = mysql_query("SELECT * FROM style WHERE style.user_id=$user_id ") or die(mysql_error()); $row = mysql_fetch_array($result ); $images = explode(',', $row['silhouettes_like']); foreach ($images as $im) { echo "<img src='$path.$im'> } ?> Since these are images which I supply and there are a finite amount of images, I'm curious why it would be better to have a separate table for the images than to keep them in a folder on my server? Also, just to clarify - each row represents a customer, there are apx. 100 columns in each row, and many of the columns represent arrays where the user can select multiple answers (this particular element has 50+ choices), so I don't believe that they can be on separate rows.
  13. Because the column is filled with values from checkboxes or multi-selects, and the user typically selects more than one answer. I don't have any trouble printing several values using mysql_fetch_array as long as I do so as text, but as soon as I try replacing the text with images I run into a problem when there more than one value. I'm not sure if this is helps, but the code that I use to update this array is: $setlist=''; foreach ($_POST as $key=>$value){ if ($key=='silhouettes_like'){ serialize($value); $value= implode(',',$value); } $setlist.=$key .'=\''.$value.'\','; } $setlist=substr($setlist, 0, -1); $result = mysql_query('UPDATE style SET '.$setlist.' WHERE user_id='.$user_id); if (mysql_affected_rows()==0) { $result = mysql_query('INSERT INTO style ('.$fieldlist.') VALUES ('.$vallist.')'); }
  14. The data looks the same as the way it is displayed as text. For this particular column the sample values when displayed as text are: turtleneck, crew, v-neck
  15. I would like to display some of the results of a mysql_fetch_array query as images instead of text, but I’m having trouble getting this to work when there is more than one value in the column (even though it is array). This displays the value as text (regardless of the number of values in the column) <?php echo $row['silhouettes_like']; ?> This replaces the text with an image, but it stops displaying images if there is more than one value in the column. <?php echo "<img src='files/" . $row['silhouettes_like']. ".png'>"; ?> The images names match the values (i.e. turtleneck) The query I’m running is: <?php $result = mysql_query("SELECT * FROM style WHERE style.user_id=$user_id ") or die(mysql_error()); $row = mysql_fetch_array($result ); ?>
  • 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.