Jump to content

cortez

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Everything posted by cortez

  1. Hello all. Hoping someone could help me modify this bit of code. <?php //create the directory if doesn't exists (should have write permissons) if(!is_dir("./files")) mkdir("./files", 0755); //move the uploaded file move_uploaded_file($_FILES['Filedata']['tmp_name'], "./files/".$_FILES['Filedata']['name']); chmod("./files/".$_FILES['Filedata']['name'], 0777); ?> I am much better with flash then php but I'm learning. This script is from a tutorial. It is protected through flash no problem but I want to make sure it is okay through the php as well. It's for a CMS I built and I only need it to allow .jpg images nothing else. Can someone lend a hand in pointing me in the right direction? Thanks
  2. Hello All. Can anyone point me in the right direction as I'm pretty stumped on this one. Basically I have an ecommerce site built in flash that has a couple URL variables to display the correct products etc. Everything is fine there but I've set up a facebook share button. In order to display the correct thumbnail image of what the user is looking at I'd like to change the meatdata in one tag before linking to the facebook share page. I have the variable in flash so I'm trying to use a simple POST php script and then send the link. Any tuts or advice to help me figure this out would be appreciated thanks.
  3. Thanks I also got it to work using "<img src='/Images/email.jpg' />"
  4. After some more research I've found a simple example that helped me get my head around it. http://code.web-max.ca/misc_htmlemail.php In case anyone else is interested.
  5. Hello all. Hoping someone can help me with adapting this email forwarding script I'm already using to attach an image that will come from a variable. The image will be on our own server. <?php $sendTo = $_POST["receiver"]; $subject = "Hello"; $headers = "From: " . $_POST["name"]; $headers .= "<" . $_POST["sender"] . ">\r\n"; $headers .= "Reply-To: " . $_POST["sender"] . "\r\n"; $headers .= "Return-Path: " . $_POST["sender"]; $message = "Our Message"; mail($sendTo, $subject, $message, $headers); ?> After researching online the best I could come up with was this (Just calling the image directly not using a variable for a test) <?php $sendTo = $_POST["receive"]; $subject = "Hello"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: " . $_POST["name"]; $headers .= "<" . $_POST["sender"] . ">\r\n"; $headers .= "Reply-To: " . $_POST["sender"] . "\r\n"; $headers .= "Return-Path: " . $_POST["sender"]; $message = "<img src="/Images/email.jpg" /><br>Thanks for visiting my web site. I hope you enjoyed it"; mail($sendTo, $subject, $message, $headers); ?> Not receiving anything with my test. Any ideas or something I'm doing obviously wrong? Any help would be appreciated. Cheers
  6. Hello All Hopefully someone can lend me a hand on this. I'm trying a small upload script to upload images to a folder on my server. It's working fine on my goddady server. The php info can be viewed here. http://cortezcreations.org/info.php It's not working on this other server where the script needs to go http://www.blushshop.ca/info.php Support for the second site is seriously lacking and I'm stuck comparing the two and why it won't work on the second and find myself completely lost. I've never had to adjust the settings myself. Here is the simple php script I am using <?php //create the directory if doesn't exists (should have write permissons) if(!is_dir("./files")) mkdir("./files", 0755); //move the uploaded file move_uploaded_file($_FILES['Filedata']['tmp_name'], "./files/".$_FILES['Filedata']['name']); chmod("./files/".$_FILES['Filedata']['name'], 0777); ?> Any advice would be greatly appreciated. Thanks
  7. Good tut and easy to understand, although when putting it into practice I keep receiving this error "Cannot modify header information" in the index file and then "Cannot instantiate non-existent class: mysqli" in the database.php So I believe it's just not connecting although I can't seem to figure out why. I've got a godaddy account running php4 is that the problem do I need to be running php5 the tut never actually clarifies this?
  8. Thanks I'll check it out right now!
  9. Can anyone point me in the right direction (tutorials or articles) to creating an Admin page for my current project. I only need to access one database, one table, one photo and a few different text fields. Alternatively is there a program I can suggest for my client he is a windows users but I don't think he's capable of getting his head around phpadmin. Any advice or direction would be greatly appreciated. Cheers
  10. Okay with the help of swfobject forum I've got everything talking together. Thought I'd share it here. Just need to create global variable to reassign it to the swfobject variable. Very useful for flash lovers! $myimageparam = ""; $links = mysql_connect("localhost", "Username", "XXXXXX") ; $res=mysql_select_db("xxxxx",$links); if(is_numeric($_GET['id'])){ $id=mysql_real_escape_string($_GET['id']); }else{ $id="The current id is not a number!"; } if($id){ $query = "select * from links where id='$id'"; $results = mysql_query($query)or die("Query error\n".mysql_error()); while ($line = mysql_fetch_assoc($results)) { echo $line['description']; $myimageparam = $line['image']; } mysql_close($links); }else{ echo $id; } ?> <script type="text/javascript"> // <![CDATA[ var so = new SWFObject('zoom.swf', 'zoom', '600px', '600px', '8', '#CCCCCC'); so.useExpressInstall('swfobject/expressinstall.swf'); so.addParam("wmode","transparent"); so.addVariable("image", "<?php echo $myimageparam; ?>"); so.write("zoom"); // ]]> </script> </body>
  11. Hey I've just been playing with my first php search engine as well. I've been working from this tutorial. It's a little old but I found it very useful. http://www.devshed.com/c/a/PHP/Creating-a-Searchable-Inventory-System-Setting-Up-Your-Database-and-User-Interface/
  12. Hello all Been battling with this for a little while and am very close. Hoping someone can help me fill in the final piece I need here. I'm retrieving a url variable with php. I am trying to send the name of a picture to swfobject variable in order to display a picture in a flash zoom script. <body> <div id="zoom"></div> <?php $links = mysql_connect("localhost", "Username", "XXXXXX") ; $res=mysql_select_db("xxxxx",$links); if(is_numeric($_GET['id'])){ $id=mysql_real_escape_string($_GET['id']); }else{ $id="The current id is not a number!"; } if($id){ $query = "select * from links where id='$id'"; $results = mysql_query($query)or die("Query error\n".mysql_error()); while ($line = mysql_fetch_assoc($results)) { echo $line['description']; } mysql_close($links); }else{ echo $id; } ?> <script type="text/javascript"> // <![CDATA[ var so = new SWFObject('zoom.swf', 'zoom', '600px', '600px', '8', '#CCCCCC'); so.useExpressInstall('swfobject/expressinstall.swf'); so.addParam("wmode","transparent"); so.addVariable("image", "<?php echo $line['image'] ; ?>"); so.write("zoom"); // ]]> </script> </body> The description Text pulls up fine and I can reference the rest of the info in the row no problem just stuck on getting it into the flash file now. Anyone had experience with this before? I'm assuming it's because I'm closing the php script before I'm retrieving the variable but I can't seem to include the Javascript in echo I tried that with no love.
  13. Okay slowly getting it. I'm able to print out any detail from the selected row. Great!!! Big step for me. Still having problems passing this newly acquired info to my flash though. But that is probably another forum completely. Thanks for the help on my newbie problems!
  14. That Works great thanks Red Arrow. I'm trying to adapt this without the xml at all though, guess I should start a new thread. I'd like to feed the path name to the image to a variable for swfobject. It would be great to get the description from this row as well to print out in a text table. I was able to make your code print out the xml no problem but I can't seem to alter it to just retrieve the path name and description. Should I start a new thread?
  15. Sorry disregard the last thread. Still rittled with errors and nothing working forgot to change the link! back to the drawing board.
  16. So I've managed to get rid of the errors. I'm still having problems parsing the data though. here is my code <?php # set appropriate content type - to tell the browser we're returning Javascript header( 'Content-Type: text/javascript' ); # include all additional files include_once 'inc.conf.php'; # retrieve Category ID from URL $id = (ctype_digit($_GET['id'])) ? $_GET['id'] : 1; $query = 'SELECT image FROM links WHERE id='" . $id . "' LIMIT 1'; $r_html = NULL; ?> <body> r_html = <div id="zoom"></div> <script type="text/javascript"> // <![CDATA[ var so = new SWFObject('zoom.swf', 'zoom', '600px', '600px', '8', '#CCCCCC'); so.useExpressInstall('swfobject/expressinstall.swf'); so.addParam("wmode","transparent"); so.addVariable("image", "<?php echo $query = ['$id']; ?>"); so.write("zoom"); // ]]> </script> </body> on my link I have http://mywebsite/Fullscreen.php?id=4 My activity page shows that it's searching for the number 4 and not the info in row 4. Is there a parsing step I'm missing?
  17. Hello Me Again. So I'm back to this again. I've figured out how to bypass creating an xml and can just pull the variable into my flash movie. I'm still having problems with <?php $id = (ctype_digit($_GET['id'])) ? $_GET['id'] : 1;query = 'SELECT image FROM links WHERE id='" . $id . "' LIMIT 1'; ?> Keeps returning a syntax error it doesn't like the " before $id. So if I'm forgetting about the xml printout is this the only php I need on this page to retrieve my info? I can directly type the path to my Photo in my url link and it loads up perfectly using <?php echo $id = $_GET['id']; ?> but you say this is a security risk.
  18. So I found a section in the config file that I had to set up to get access to the path in my database I wanted to select and have it showing up in the correct cell. I managed to get my picture to upload using this synatx $r_html.= '<td><img src=\'' . $db_result['part_image'] . '\' border=0 alt=\'' . '\'></td>'; This issue is solved. Thanx
  19. I already have the image path in my database and am able to call it up and display no problem on a simple trial. My problem here is pulling it up into this table. I'm sure it's my syntax on this line. $r_html .= '<td>' . "<img src=\"" . $db_result['part_name_image'] . "\">"; '</td>'; Not 100% sure how to code this. On a direct query I am able to pull it up like so with the picture being a link echo "<a href=\"" . $row["link"] . "\"> <img src=\"" . $row["image"] . "\" border=0 alt=\"" . $row["text"] . "\"> </a>" ; Thanks for your suggestions.
  20. Hello all Can anyone help me with this script I'm working on. It's from the tutorial for setting up a searchable database. http://www.devshed.com/c/a/PHP/Creating-a-Searchable-Inventory-System-Setting-Up-Your-Database-and-User-Interface-continued/ I was hoping I could just call the appropriate image path and dump it in on the results page only. <?php $r_html = NULL; $r_row_count = 0; # using helper function, run query and retrieve raw results $db_results = $search->get_search_results(); # if results have not been returned, display error message if ( !is_array( $db_results ) || count( $db_results ) == 0 ) { $r_html .= 'No results were found for the search criteria you specified. Please try again.'; # if results have been found, output them properly } else { $r_html .= 'Your search returned the following results: <br><br>'; $r_html .= '<table width="100%">'; $r_html .= '<tr>'; $r_html .= '<th>' . $search->get_header_html( 'Category', 'pc_categories.name' ) . '</th>'; $r_html .= '<th>' . $search->get_header_html( 'Title', 'pc_sub_categories.name' ) . '</th>'; $r_html .= '<th>' . $search->get_header_html( 'Time Period', 'pc_manufacturers.name' ) . '</th>'; $r_html .= '<th>' . $search->get_header_html( 'Name', 'pc_parts.name' ) . '</th>'; $r_html .= '<th>Description</th>'; $r_html .= '</tr>'; # for each result found, return a table row foreach ( $db_results as $db_result ) { # using row count, determine appropriate CSS class $l_css_class = ( ++$r_row_count % 2 == 1 ) ? 'odd' : 'even'; # output table row of results $r_html .= '<tr class="' . $l_css_class . '">' //I tried to add in the image path here $r_html .= '<td>' . "<img src=\"" . $db_result['part_name_image'] . "\">"; '</td>'; $r_html .= '<td>' . $db_result['category_name'] . '</td>'; $r_html .= '<td>' . $db_result['sub_category_name'] . '</td>'; $r_html .= '<td>' . $db_result['pc_manufacturer_name'] . '</td>'; $r_html .= '<td>' . $db_result['part_name'] . '</td>'; $r_html .= '<td>' . $db_result['part_description'] . '</td>'; $r_html .= '</tr>'; } # END for each result # close table $r_html .= '</table>'; } # END if results found # display results HTML echo $r_html; ?> Is this possible to call up the image here or will I need to include the path to the image in the previous search functions as well? If this is an easy fix I'll be through the roof! Cheers Curt
  21. Thanks for your help on this. I've been moving around city to city and finished off another flash site so I haven't had a chance to try this yet. Although I've a better understanding how useful the url variable is!
  22. Thanks again for the guidance. Like i mentioned I'm pretty new to mysql and php working together. I normally just work with flash, css, html with a bit of xml and javascript so throwing in another couple languages can be somewhat trying. Although I'm excited by what I'm learning it can do! Can you explain a little how I make sure of this? Is it just with the row id? It's set to auto-increment at the moment. I obviously need to do more research as I believe the url variable will suffice to call my variable into flash without the need of the xml.
  23. Thanks for getting back so quick. All I really want from this is for the xml to be behind the scene and store the path to my current image. So the code would be something like. <?xml version="1.0"?> <links><item>Photos/Feather-Dancers.jpg</item></links> I did see some different threads mentioning something about passing the variable directly through the url link. For example http://www.website.com/filename.php?row=1 and then called by row_id = $_GET['row_id'] Any direction at this point would be greatly appreciated. Thanks
  24. Hello all New to the forum and new to php and mysql together but here goes. I'm building a searchable database that displays an image that is a link and text. It displays all the results fine. I'd like to have the link load a new php script that outputs the path to the current image with an xml so that I can call it into a flash image zoom. <?PHP $link = mysql_connect ('localhost', 'UserName', 'Password') ; mysql_select_db("db_name"); $query = 'select * from links where id= ***this is where I need a variable or some way to keep track of my id number****'; $results = mysql_query($query); echo "<?xml version=\"1.0\"?>\n"; echo "<links>"; while ($line = mysql_fetch_assoc($results)) { echo "<item>" . $line["image"] . "</item>"; } echo "</links>"; mysql_close($link); ?> If anyone understands what I'm after and can help with an explanation or link to a tutorial It'd be greatly appreciated. Thanks.
×
×
  • 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.