Jump to content

swissbeets

Members
  • Posts

    57
  • Joined

  • Last visited

    Never

Posts posted by swissbeets

  1. im sure this is an easy question i just havent done it before, i need to list my pictures in a table that will continuously show them but only show about 4 per line. right now i have something like this

     

     

    <table border="1">
    
    while($row = mysql_fetch_array($photos))
    {
    ?>
    <tr>
    <td><?php
    $picture = "images/" . $row['image_source'];
    		mysql_prep($picture);
    		?><img src="<?php print $picture;?> "width="120" height="120">
    </td>
    
    <?php
    }?>
    </tr>
    

     

  2. I am using the uploader.php that is in a tutorial to upload pictures to my site. but when i upload them everything is working fine except that the pictures are not being saved in my images folder(everything being, the name is saving in the database and being called correctly)

     

    maybe another set of eyes could help me spot the problem, here is my code

     

    <?php require_once("includes/session.php"); ?>
    <?php require_once("includes/connection.php"); ?>
    <?php require_once("includes/functions.php"); ?>
    <?php confirm_logged_in();
    //echo "<pre>";
    //print_r($_FILES);
    //echo "</pre>";
    $target_path = "images/".$_FILES['uploadedfile']['name'];
    move_uploaded_file($_FILES['uploadedfile']['tmp_name'],$target_path);
    $image_source = mysql_prep($_FILES['uploadedfile']['name']);
    $id = $_GET['page'];
    $query = "UPDATE pages SET
                                image_source = '$image_source'
                            WHERE id = $id";
    
                    $result = mysql_query($query);
                    if (mysql_affected_rows() == 1) {
                        redirect_to("edit_page.php");
                    } else {
                        // Failed
                        $message = "The product update failed.";
                        $message .= "<br />". mysql_error();
                        echo $message;
                    }?>
    

    here is where the actualy information is coming from

     

    <form enctype="multipart/form-data" action="uploader.php?page=<?php echo $sel_page['id']; ?>" method="POST">
    
    <input type="hidden" name="MAX_FILE_SIZE" value="100000" />
    
    Choose a file to upload: <input name="uploadedfile" type="file" value= "<?php print $sel_page['image_source']; ?>"/>
    
    <input type="submit" value="Upload File" />
    
    </form>
    

  3. check the persons level initially then, store it in a session, then when you want to check or redirect, just check the session and do so depending on what is stored

    here is a simple one for my logged in or not

     

    session_start();
    
    function logged_in() 
    {
    	return isset($_SESSION['user_id']);
    }
    
    function confirm_logged_in() 
    {
    	if (!logged_in()) 
    	{
    		redirect_to("login.php");
    	}
    }
    

     

    then i check if they are logged in by  confirm_logged_in()

    but you could make a function that will always get the level by something like

     

    $level= ($_SESSION['level']);

     

    then use $level to redirect or whatnot

     

    is fife a nickname?

     

  4. i kind of assumed that

     

    "$target_path = "images/ ".$_FILES['uploadedfile']['name'];

    move_uploaded_file($_FILES['uploadedfile']['tmp_name'],$target_path);

    $image_source = mysql_prep($_FILES['uploadedfile']['name']);

    "

     

    was moving a file, is it not?

     

    my code  (i thought) was saving the file in my images folder and then saving the name in my database is that not what this is doing with the uploader? if not what is it doing?

     

     

  5. i have a back end part to my site so someone can easily update the products.  i want it to be able to save pictures from my desktop in my website images folder

     

    ithought it worked but it definitely doesnt  i  am pretty sure its because the images arent saving right

     

    here is my code i took it from a tutorial and based it to needs

     

    <?php require_once("includes/session.php"); ?>
    <?php require_once("includes/connection.php"); ?>
    <?php require_once("includes/functions.php"); ?>
    <?php confirm_logged_in(); 
    //echo "<pre>";
    //print_r($_FILES);
    //echo "</pre>";
    $target_path = "images\ ".$_FILES['uploadedfile']['name'];
    move_uploaded_file($_FILES['uploadedfile']['tmp_name'],$target_path);
    $image_source = mysql_prep($_FILES['uploadedfile']['name']);
    $id = $_GET['prod'];
    $query = "UPDATE products SET 
    						image_source = '$image_source'
    					WHERE product_id = $id";
    //print $query;
    			$result = mysql_query($query);
    			if (mysql_affected_rows() == 1) {
    				redirect_to("edit_product.php");
    			} else {
    				// Failed
    				$message = "The product update failed.";
    				$message .= "<br />". mysql_error();
    			}?>
    

     

    does anyone see anything i am doing wrong?

  6. yea i didnt want to take the responsiblty of actually taking the money and the guy wanted me to have all of the credit card info emailed to him, needless to say i had to talk him out of that and after a day or two i got the google checkout to work.

     

    i am trying to center the whole page right now, but have have no idea what the first step would be 

     

    any suggestions?

  7. i am reading a book on CSS right now so dont know that much just yet but how hard will it be to take out the tables and use CSS? also i basically did the lynda.com tutorial and changed it to fit my needs, i have never used php before nor have i really made a live site before. I basically just wanted to learn how to do this and figured the best way would be just dive in.

     

    the yellow is bright but i wanted it to match the big peckers logo. but i will keep that in mind

     

    yea, i heard it would be much easier to do the rollovers in css but i didnt wana fix something that was already working

     

    thank you very much for your input

  8. this is the first site ive done and i know there is still alot of things that need done but let me know if you see anything that wont take me a week to learn to first, or anything someone knows how to explain

     

    www.bigpeckersstuff.com

     

    (i am getting a picture to put on the homepage right now it should be up soon)

     

    thanks

  9. i did this with my checkout but cannot seem to get it to work in my other form

     

    i am using

     

     

    <input type="image" name="submit" alt="Add to Big Peckers Shopping Cart"

        src="images/addtocart.gif" height="46" width="180"/>

     

     

    the code on my other form is

     

     

    <input type="image" name="Google Checkout" alt="Fast checkout through Google"

        src="https://checkout.google.com/buttons/checkout.gif?merchant_id=*************&w=180&h=46&style=trans&variant=text&loc=en_US" height="46" width="180"/>

     

     

     

    does anyone have another example or see a dumb mistake i am making?

  10. eventhough i redid the navigation bar with dreamweaver and assigned only the up image, it is still using many of these javascript functions

     

    here is my code

    <td id="page"><a href="/index.php" target="_top" onclick="MM_nbGroup('down','group1','home','',1)" onmouseover="MM_nbGroup('over','home','','',1)" onmouseout="MM_nbGroup('out')"><img src="/images/home.gif" alt="" name="home" width="75" height="100" border="0" id="home" onload="" /></a><br />
    	  <a href="/Products.php" target="_top" onclick="MM_nbGroup('down','group1','products','',1)" onmouseover="MM_nbGroup('over','products','','',1)" onmouseout="MM_nbGroup('out')"><img src="/images/products.gif" alt="" name="products" width="75" height="100" border="0" id="products" onload="" /></a><br />
    	  <a href="/shoppingcart.php" target="_top" onclick="MM_nbGroup('down','group1','shoppingcart','',1)" onmouseover="MM_nbGroup('over','shoppingcart','','',1)" onmouseout="MM_nbGroup('out')"><img src="/images/shoppingcart.gif" alt="" name="shoppingcart" width="75" height="100" border="0" id="shoppingcart" onload="" /></a><br />
    	  <a href="/contactus.php" target="_top" onclick="MM_nbGroup('down','group1','contactus','',0)" onmouseover="MM_nbGroup('over','contactus','','',0)" onmouseout="MM_nbGroup('out')"><img src="/images/contactus.gif" alt="" name="contactus" width="75" height="100" border="0" id="contactus" onload="" /></a><br />
    

     

    it seems like it might be easier for me to just make it from scratch

  11. i will change that immediately thank you,  i know very little javascript but figured since dreamweaver made it i might as well use it,    i believe i got it working a lot better.    please let me know of anything else you see it is greatly appreciated. i will attempt to get it validated today and then post my site to be critiqued

     

    but even with the javascript in the head i am getting 70 errors with at least 50 from the javascript is this  alarge enough problem that i should take the way you posted earlier?

×
×
  • 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.