Jump to content

kuyaRomeo

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

kuyaRomeo's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. In a nutshell: I am using Mysql to query a table, and bring back the results, then doing a php WHILE, and in that while I am placing an image for each record. I want to do a swap image for another image . . on this image. So that is why it is done using "echo statements" and not raw html. I have tested it in HTML and it works fine, but I must be missing something here: <? while($row = mysql_fetch_array($result2)) { $thumb = $row['thumb']; $dirdesimage = $row['dir_des_image']; echo "<a href='http://mysite.net/director/vidpop.php?val1=". $vid ."'onclick='basicPopup(this.href);return false' onmouseout='MM_swapImgRestore()' onmouseover='MM_swapImage('movieThumb','','http://mysite.net/images/gallery/".$thumb."',1)'><img src='http://mysite/director/images/reel.png'></a>"; } ?> When I mouse over the reel image above . . the other image does nothing. This is the image that should be swapping out: <? echo "<a href='#' onmouseout='MM_swapImgRestore()' onmouseover='MM_swapImage('movieThumb','','http://cantankerousme.net/images/gallery/".$thumb."',1)'><img src='http://cantankerousme.net/images/gallery/OR_trailer_thumb.png' name='movieThumb' width='330' height='230' border='0' id='movieThumb' /></a></div>"; ?> </div> This way, in plain HTML I am doing the same thing, basically and it is working. I am using one image to control the swap out of another image and it works fine . .so what am I missing in the php echo statement ?? <div id="tester"> <a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('movieThumb','','../images/gallery/TTN_trlr_thumb.png',1)"><img src="../images/gallery/<? echo $thumb; ?>" name="Image5" width="330" height="230" border="0" id="Image5" /></a> </div> Thanks for your insight
  2. Two part question: 1) I have a MySql table called "lang_key", which will store all of the common text for a site, which will allow easy site modifications from the "non tech" admin. Now, I am creating a recordest that will pull the information from the table, and create a basic list of variables in php. For example: I connect to the database, and do a wildcard select. I can figure out how to set a basic php variable like the example below: $query1 = "SELECT * FROM lang_key"; $result = mysql_query($query1); while($row = mysql_fetch_array($result)) { $template = $row['common_text']; } There are three fields in my lang_key table (unique_id, string_id, and common_text') What I want to do is take it a step further from the example and I want $template to be the value of "common_text" Where string_id = "curr_template" I hope this makes sense? I really just want to create my recordset and then populate the website with the recordset info. Part II Do you recommend that I use a lang_key database, or would it be simpler and more efficient to just create a lang page with static variables, and use the php file write option to update the page? Thanks!!!
  3. @teynon Sorry about the typo (Tenyon) . . . . fell behind on work and skipped proof reading before posting. Sorry.
  4. Thank you both Tenyon and siva.katir for your help!! I was able to get the unlink function to work by using the /home/account/public_html/showcase/ path instead of the www url. Thank you so much for helping me . . I have struggled for the last two days trying to figure out why this was not working for me. As for the validation and security . . . Already there is a log in session required. The only one who will be deleting items will be the admin. This unlink function is only available to the admin, when logged in. I am simply creating a way for the admin to load and unload items to display in her showcase. Also, I will change the way the item is deleted. Instead of passing the name of the image directly from the POST form, I will pass a hidden ID and draw the name of the image from SQL Select on that ID. Do you think this will be enough? Thanks again
  5. Thanks for the fast response. Couple questions: (1) when you say try it without the url, does that mean the script must be in the showcase folder? I have tested this and it works, but I also have a showcase/thumbs folder with a second image to delete, and I would prefer to do it within one script if possible? (2) Not sure what I need to do for the validation of post value???? Can you point me in the right direction here? On my form, I have a delete button. Also on the form is a text box that displays the name of the image. the textbox name is 'url2'. This is the value I pass over to the delete script . . the name of the image to delete. What type of validation can I do to ensure only .jpg files can be passed? What other validation would make this more safe?
  6. I have a few years experience in php, but nothing too hard core. Right now I am trying to create a delete button on a form that will remove the MySql content for the item selected and also delete the image related to the item. The unlink function is turning into a headache, and I can't seem to get it just right. Here is what I have (below) and hoping someone can point me in the right direction to get this corrected. $urldel = $_POST['url2'] if (file_exists("http://www.mysite.com/showcase/".$urldel) { echo "File does exist"; unlink("http://www.mysite.com/showcase/".$urldel); } else { echo "The file does not exist"; } Additional Information: The passing of the name of the image as $urldel works fine. If I simply do a print of $urldel, it shows correctly. Also, If I put the delete script directly inside of my image folder, and use just the image name, unlink works correctly, so I gather there is something wrong in how I am creating my url with the $urldel. Thanks in advance
×
×
  • 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.