Jump to content

CSmith1128

Members
  • Posts

    46
  • Joined

  • Last visited

    Never

Everything posted by CSmith1128

  1. i need some help searching queries. i want to search a query to find all the results that match a column on one table to a variable and a column on another table to a varaiable. so heres an example. i want to find everything where firstname='joe' and lastname='long' on table_names and favorite_color='green' on table_colors and name_id on table_names = name_id on table_colors. make sense? if not i can just get all of the name_ids for every row that firstname='joe' and lastname='long' on table_names and put the name_id for every row into an array, then loop through that array and check every row on table_colors where name_id= the id in the array and favorite_color='green' and then erase the ones that don't meet that criteria. is there any way of doing it all in one query? thanks, chris
  2. i need some help with folder restrictions. i have a site where users can leave comments/feedback. i have the body of the comment written to a text file. so, when the user hits "submit comment/feedback", the text is written to a text file. i also have it set up so the user can click a link to delete the file that was written. i want to know what folder settings i should use that will allow the users to edit, write, and delete their text files through links/ forms on my site. right now i have it set up to 0777, but i know that setting is unsecure. which setting should i use to accomplish this and is there anything spcecial i have to write in the code to use this restriction? thanks chris
  3. yeaa that works, however, in the text area it shows "br \".. I just want it to show lines in the text area instead of the actual html... this is what I am trying to put into the text area... $doubleLine = "-----------------------------------\n-----------------------------------"; $line = "-----------------------------------"; $newMessageValue = "\n\n\n\n\n" . $doubleLine . "\nMessage From: " . $firstname . " " . $lastname . "\n" . $tmonth . " " . $tday . ", " . $tyear . " at " . $thour . "\n" . $line . "\n" . nl2br($oldMessage); with that, everything works fine and when it sends it to the script, it shows up how I want it.. so I can change the lines to the following, but then it shows up with the br \ in the text area, which i am trying to avoid if possible.. $doubleLine = "-----------------------------------br /-----------------------------------"; $line = "-----------------------------------"; $newMessageValue = " br / br / br / br / br /" . $doubleLine . "br /Message From: " . $firstname . " " . $lastname . "br /" . $tmonth . " " . $tday . ", " . $tyear . " at " . $thour . "br /" . $line . "br /" . nl2br($oldMessage); is there away around that? if not i can live with it showing the br / in the text area.. Note: in the code above it needs the < and > around br \ , i just left it out because it doesnt show up when the topic is submitted, and i dont know a way around it.
  4. ok.. heres what I have... i am making a message system where the users can send eachother messages. I have a reply feature so they can reply to messages received. The problem I am having deals with line breaks. - I store each message in a text file. - When the user clicks reply, it takes the text from the text file and store it into a text area form box. - To insert the line breaks I use \n. It shows up fine in the text area. - Now when I send it to the script, I use $_REQUEST['message']; to retreive it. - To debug it, I have the text displayed on the page so I know what it looks like before it is stored. - However, it does not show the line breaks. - I have tried changing the line breaks to html using <br>, however, when it is displayed in the text area, it shows <br> instead of the actual line break. So if i want to display the previous message, it shows <br> instead of the line. - Does anyone know away around this so I can show the line breaks in both the text area and text file without having the user see <br>? - Also, when the user inserts a new line in the text area when the are typing a new message it does not show up as a new line.. is there a fix for this too? Thanks Chris
  5. is there another setting I could use that would allow a script to create a file, write to the file, and delete the file?
  6. Hello. I need some help creating text files. I want to set my access rules to 0777 so that I can delete the text file via script if I need to. I already set the folder to 0777 when I created it.. now I just need the text files. How would I set the access to 0777 when I create the file? This is what I have right now... $text= "this is text."; $fileName = "examplefolder1/example.txt; $handle = fopen($fileName, 'w'); fwrite($handle, $text); fclose($handle); Is there some way to do it in that statement? Thanks Chris
  7. Hello. I need some help filtering user input. I want to take text that a user inputs and store it into a variable. That's the easy part. I have and array of 30 elements that I want to store the inputted text into. So.. here's an example... - I want a user to enter text. - I'll store it into a variable like $inputText. - I want to split the text from $inputText into 30 equal sections and store each section into an element in the variable. - I don't care if the words get separated during the filter, as long as the whitespaces stay where they are. Could anyone give me some tips to help me get started or point me towards a tutorial or something? Thanks, Chris
  8. are you supposed to have 3 "mmm"s in .$row['commments'] ?
  9. Hello. I need some help retrieving data from a URL. I want to make it easier for a user to get to a comment on my page and to be able to go directly to that comment when it is typed into the URL. For example, instead of this: http://www.mysite.com/comments.php?id=1 I want them to be able to do this: http://www.mysite.com/1 I am just wondering how to retrieve the "1" from the url instead of having to type id=1 and store it into a variable. I know that the second one is pointing to my homepage instead of comments.php, and thats fine. I am just going to redirect to the other page or include the other page after I retrieve the "1". Could someone help? Thanks, Chris
  10. yea i did session_start() at the top. intval() worked.. thanks!
  11. yea sorry.. here is the code i am using... $num1 = $_SESSION['num1']; $array1= array(); $array2= array(); $x = 0; $fileName = "file.txt"; $handle = fopen($fileName, 'r'); while (!feof($handle)) { $array1[$x] = fgets($handle); $array2[$x] = fgets($handle); $x++; } fclose($handle); if($num1 == $array1[0]) { echo "ok"; } //---------------------------------------------------------------------- //---------------------------------------------------------------------- i am trying to compare the two values, but it doesnt seem to work. the values: $num1 = 1 and $array1[0] = 1.
  12. Hello. I need some help with arrays. I am trying to get the contents of a file and put them into an array. I have everything working so far, except when I want to compare the contents of an element in an array with another variable. The other variable is coming from a session. So i have something like this. $num1 = $_SESSION['num1']; and i have an array set with data from the text file.. Now i want to see if($array1[0] == $num1). When they are equal to eachother, I want to display "ok". So everything should work, and I know the two equal eachother, but it never says they are equal. When I set $num1 = 1; they say they are the same, but when i use the sessions it never says they are the same, but I know they are. Could someone help me figure this out? Thanks, Chris
  13. hey.. i need some help with arrays. here's what i need to do... -i have prices stored in a db. -i would like to have 2 arrays. -i need to store the price in one array then the item name in another array. -then i need to sort the array by price starting from the highest price to the lowest price. can someone help?! basically i need a general idea of.. 1. how to put items in an array from a loop and 2. how to sort and array by the price. thanks! Chris
  14. hello... i need some help showing pictures on my page.. here's the deal.. - i have a page with 4 pictures on it. - i have 1 large picture and 3 thumbnails. one of the large picture and two others. - i was wondering how i could have the user click on the thumbnail and, without having to reload the page, have a larger version of the image clicked on appear where the other large image is. - i have the large versions of the pictures stored in a folder called large and the thumbnails of the images stored in thumbs. so when the user clicks on the image, it appears larger in a box above the thumbnails. i would like to do this all without reloading the page. could someone help? Thanks!
  15. Hello... I need some help with dates... I had the user input a date using 3 different for fields. When the submit it, i have 3 variable, one for month, one for day, and one for year. Each one has a number that represents the mont, day and year. For example, January 1, 2006 would be stored like this.. $month = 1, $day = 1, $year = 2006 I need to do two things. I already have validation for the correct number of days in each month. However, I need to check whether the date they entered has not passed already. To do this, I need to get the current date. How would I get the current date and separate each part of it into separate variables for month, day, and year? Also, after I validate each component, how would I convert the date back into the following format... 2006-05-23 Could someone please help? Thanks, Chris
  16. [!--fonto:Tahoma--][span style=\"font-family:Tahoma\"][!--/fonto--]Hello.. I need some help uploading images... First, I would like to have a page where a user can upload multiple images from 1 place (up to 3 images). So I would like to have 3 browse fields on the page and when they click submit they will be uploaded. Next, I would like to resize EACH image to 4 different sizes, then store each one in a different folder. I do not need to store the original image, only the resized images. And I need each image to be resized so they are not blurry or distorted. So I need an image to be 100 pixels x 80 pixels. The image can be smaller if it needs to be so it won't be distorted, but it cannot be any larger. Could someone help me with this? :-) Thank you, Chris [!--fontc--][/span][!--/fontc--]
×
×
  • 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.