Jump to content

jpratt

Members
  • Posts

    144
  • Joined

  • Last visited

    Never

Everything posted by jpratt

  1. Cant get this thing to work, does anyone have a better way of doing a file upload.
  2. thanks for the clean up. but it still does not function. I have checked my php.ini and verified it allowed uploads. Somthing is still wrong.
  3. all php tags are closed. I dont see a problem.
  4. page is at www.myplasmaart.com/upload.php
  5. What part of the page do you want centered? What does you HTML look like?
  6. I have the following script i am working with to upload an image. as far as i can tell the code works fine. When i go to display the page it wont come up and wont give an error, just a blank white page: [code] <?php if ($_SERVER['REQUEST_METHOD'] != 'POST') { $me = $_SERVER['PHP_SELF']; ?> <form name="form1" method="post" action="<?php echo $me;?>" enctype="multipart/form-data">               <table width="500" border="0" cellspacing="3" cellpadding="0">                 <tr>                   <td width="256" height="30" align="right" valign="middle"><p align="right"><span class="style1">Comment for Photo</span></p></td>                   <td width="344" align="left"><input name="textfield" type="text" size="40" /></td>                 </tr>                 <tr>                   <td height="30" align="right" class="style1">Website Link </td>                   <td align="left"><input type="text" name="textfield2" />                     <span class="style1">ie. www.google.com</span> </td>                 </tr>                 <tr>                   <td height="30" align="right"><span class="style1">Photo </span></td>                   <td align="left"><input type="file" name="imagefile" /></td>                 </tr>                 <tr>                   <td>&nbsp;</td>                   <td align="left"><input name="Submit" type="submit" value="Submit" /></td>                 </tr>               </table>               </form>   <?php   }   else{   if(isset($Submit)){   $file=$_FILES['imagefile']['name'];   $filetype=substr($file,-4);   if($filetype=="jpeg"){     copy($_FILES['imagefile']['tmp_name'],"UploadImg/".$_FILES['imagefile']['name'])     or die("Could not copy");     echo"<br>Upload Complete";     echo"<br>Name:&nbsp;".$_FILES['imagefile']['name']."";     echo"<br>Size:&nbsp;".$_FILES['imagefile']['size']."";     echo"<br>Type:&nbsp;".$_FILES['imagefile']['type']."<br>";   }elseif($filetype==".jpg"){     copy($_FILES['imagefile']['tmp_name'],"UploadImg/".$_FILES['imagefile']['name'])     or die("Could not copy");     echo"<br>Upload Complete";     echo"<br>Name:&nbsp;".$_FILES['imagefile']['name']."";     echo"<br>Size:&nbsp;".$_FILES['imagefile']['size']."";     echo"<br>Type:&nbsp;".$_FILES['imagefile']['type']."<br>";   }elseif($filetype==".png"){     copy($_FILES['imagefile']['tmp_name'],"UploadImg/".$_FILES['imagefile']['name'])     or die("Could not copy");     echo"<br>Upload Complete";     echo"<br>Name:&nbsp;".$_FILES['imagefile']['name']."";     echo"<br>Size:&nbsp;".$_FILES['imagefile']['size']."";     echo"<br>Type:&nbsp;".$_FILES['imagefile']['type']."<br>";   }elseif($filetype==".gif"){     copy($_FILES['imagefile']['tmp_name'],"UploadImg/".$_FILES['imagefile']['name'])     or die("Could not copy");     echo"<br>Upload Complete";     echo"<br>Name:&nbsp;".$_FILES['imagefile']['name']."";     echo"<br>Size:&nbsp;".$_FILES['imagefile']['size']."";     echo"<br>Type:&nbsp;".$_FILES['imagefile']['type']."<br>";   }else{     echo"<br><span class="subtitle">Upload Error</span>";     echo"<br>Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['name'].")<br>";   } } } ?>[/code] Any ideas?? Please Help!
  7. if you are just looking at the html code then just comment out the blocks of php code, rename to html,  until you have the look you want. When you are finished testing, name it back to php and uncomment the php code blocks.
  8. 1. The username and password should be stored in a table in your database. When the user logs in it checks to see if the record exists in that table with a valid password. Then if it is correct, store the username as a session varible, or run queries to get the information needed based on the user that logged in. 2. The SQL statement that is used to retrieve client information will be custom depending on what information you need and how your database is set up. Google some SQL tutorials to see how to retrieve data thru SQL statements. 3. To move your db from your local machine to your web server, you create a .sql backup of your database on you local computer. Their should be a operations section under MySQL Administrator if your using that. Anyway that created a .sql file this contains a bunch of create table commands and insert commands. Copy and paste this into a SQL window within phpmyadmin for your web server database and run it. It will create your tables and populate them for you, (if you have any data yet that is).
  9. One good hosting company that allows remote db connections is hostmysite.com. Plus their support is great.
  10. So you are running on localhost trying to connect to your db at geocities? If so, alot of hosting companies will not allow remote connections to their db severs except thru their own hosting servers. Just one thought.
  11. If the user types arcticsoft.net they get the main account page under htdocs, if they type alaskanflyrod.com they are redirected to the akrod folder and that site opens up.
  12. my host is arcticsoft.net, how should it look then?
  13. I am new to doing redirects and found a script to try, it looks like this: [code]<? $remote = getenv("HTTP_HOST"); $fp = fopen("redirect.txt", "r");  while (!feof($fp)): $line = fgets($fp,1800);  $line_list = explode("|",$line);  $url1 = $line_list[0]; $url2 = $line_list[1]; $redirect = $line_list[2]; if ($url1 == $remote or $url2 == $remote): Header("Location:$redirect"); $closefp = fclose($fp);  endif; endwhile; $closefp = fclose($fp);  ?> [/code] Also the text file: alaskanflyrod.com|www.alaskanflyrod.com|akrod/index.php and the header in the main account index page pointing to the redirect.php page: <? require("redirect.php");?> any ideas why this is not working? Thanks for the help.
  14. MS Access has an upgrade utilitly. Run that and it will createyou autonum fields for you. You may need to set up your relationships after running this. Also as caution, check all your fields indexes and key fields and the utility tend to change some fields into something you don't want. But using the tool it saves alot of time in recreating tables.
  15. using the auto start would be a bad idea if part of your is not part of a session, right? Part of the site takes cc#'s and phyical address and email addresses and the part of the site that is not part of the session is not secure. What is your opinion?
  16. Thanks, works great. I inherited this site and have been trying to get it going with a new hosting company, I have no idea on how they got it going with their old hosting. Again, thanks a bunch!!
  17. Do I need anything at the beginning of the next page to reference these variables?
  18. [img src=\"style_emoticons/[#EMO_DIR#]/excl.gif\" style=\"vertical-align:middle\" emoid=\":excl:\" border=\"0\" alt=\"excl.gif\" /] I am unable to get values from two login fields into session variables. The following code is not putting the values from my text fields into my session variables: <? if(isset($_POST['SID']) && isset($_POST['EID'])) { $_SESSION['SID']=$_POST['SID']; $_SESSION['EID']=$_POST['EID']; header("Location: owner/main.php"); } ?> . . . . . <form name="login" method="post" action="login.php"> <input name="SID" type="text" class="inputbox" size="50" maxlength="50"> <input name="EID" type="text" class="inputbox" id="EID" size="50" maxlength="60"> <input name="Submit" type="submit" class="btn" value="Login"> </form> Any ideas? Please help!!!
×
×
  • 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.