Jump to content

Lessur

Members
  • Posts

    26
  • Joined

  • Last visited

    Never

Everything posted by Lessur

  1. is it the servers problem?
  2. I have this code: <?php if(isset($_POST['submit'])) { $to = "Email here, blah"; $subject = "ALBUM REQUEST"; $name = $_POST['name']; $email = $_POST['email']; $add = $_POST['add']; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip']; $tel = $_POST['tel']; $body = "From: $name\n E-Mail: $email\n Address: $add\n City: $city\n State: $state\n Zip: $zip\n Tel: $tel"; mail($to, $subject, $body); echo "Thanks! Data sent to $to"; } else { echo "blarg!"; } ?> and of course I have a form for this on another page, but for some reason, even when i get the confirmation text, it just doesn't send. Why?
  3. I followed this website: http://www.webreference.com/programming/php/phpemail/index.html And i keep getting that all fields are required, even when i put data in. it is like it is not getting the data. Look at it at: http://b4ls.joolo.com/index.php If you need the code that i edited a bit just ask. Thanks.
  4. " <form .. action="?id=$id&submit='OK'" " ?  could you include it all please?
  5. Is whast you want is like an outline? I. Category 1   A. Comment 1   B. Comment 2 II. Catergory 2   A. Comment 1   B. Comment 2 ?
  6. Ok, I have an flash submission system.  You upload the flash file, along with some comments, a title, etc, it puts the information in a mySQL database, give it an id, and you can access it via view.php?id=(id here). I want to make an edit submission page, so I did the following, for editsub.php: [code]<?php   if ($_SESSION['username']){     $sql=mysql_query("SELECT * FROM `portal` ORDER BY id DESC LIMIT 0 , 200 ") or die(mysql_error());   while ($row=mysql_fetch_array($sql)){   $i++;   $id=$row['id']; //Id   $title=stripslashes($row['title']); //Title   $author=stripslashes($row['user']); //Username     $small_image=stripslashes($row['small_image']); //Small icon to go with the submission   if ($author == $username){ echo "<a href='editsub2.php?id=$id'><img src='small_images/$small_image' width='50' height='50' border='0'>&nbsp;&nbsp;$title by $author</a><br>"; } else{ echo ""; } } } else { echo "<div align='center'>You must be logged in to edit submissions!</div>"; }?>[/code] That, you access when you are logged in, generating a page with all of your submissions on it.  Now, if you may have noticed, each links to editsub2.php?id=$id . This is editsub2.php: [code]<?php if (is_numeric($_GET['id'])){ if ($_SESSION['username']){ if ($_GET['submit']){ $check=mysql_num_rows(mysql_query("SELECT * FROM `portal` WHERE id = '$id' LIMIT 1")); if ($check == 1){ $sql=mysql_query("SELECT * FROM `portal` WHERE id = '$id' LIMIT 1"); $row=mysql_fetch_array($sql); $title_show=stripslashes($row['title']); $wide_show = stripslashes($row['wide']); $high_show = stripslashes($row['high']); $title_show=stripslashes($row['title']); $author_show=stripslashes($row['user']); $desc_show=stripslashes($row['desc']); // USED TO UPDATE DATABASE $title=addslashes(strip_tags($_POST['title'])); $desc=addslashes(strip_tags($_POST['desc'])); $wide=addslashes(strip_tags($_POST['wide'])); $high=addslashes(strip_tags($_POST['high'])); $terms=addslashes(strip_tags($_POST['terms'])); if ($title == ""){ echo "Field title left blank <a href='?'>Go back?</a>"; } elseif($desc == ""){ echo "Field desccription left blank <a href='?'>Go back?</a>"; } elseif ($wide == ""){ echo "Field width left blank <a href='?'>Go back?</a>"; } elseif ($high == ""){ echo "Field height left blank <a href='?'>Go back?</a>"; } elseif (!is_numeric($wide) || !is_numeric($high)){ echo "Field width or height false <a href='?'>Go back?</a>"; } elseif ($terms == ""){ echo "You did not agree to are Terms of Use! <a href='?'>Go back?</a>"; } else{ $sql=mysql_query("UPDATE `portal` ( `title` , `desc` , `wide` , `high`) VALUES ('$title', '$desc', '$wide', '$high')"); if ($sql){ echo "Success! Submission updated!! - <a href='index.php'>Index!</a>"; } else { echo "Failed"; }[/code] I have a form on the page also, with: [code]<input name="title" type="text" id="title" value="<?php echo "$title_show"; ?>" size="20" maxlength="15">[/code] For example.  So to my understanding, this should work.  On editsub2.php it should show the $title_show in the database as the value for the textboxes, and should update the submission.  but this does not work.  It does not give the values to the textboxes, and when i click the submit button, it clicks and nothing happens. Help?
  7. Oh, for the reg file upload (that works)  I have this code: $upload = dirname(__FILE__)."/uploads/"; But for the small image one I have: $upload2 = dirname($smallimagepath); Instead should I have: $upload2 = dirname(__FILE__)."/small_images/"; ? Or what does __FILE__ do?
  8. Ok, I have come back to this topic becasue I was out of town.  The image did not exceed the max filesize.  I still don't know how to fix this.  I have tried all the above.  But when I clikc submit I get: "Error! Couldn't upload 50x50 Image!" Which is this line: [code]copy($_FILES['small_image']['tmp_name'],$upload2.$small_image) or die("<br>Error! Couldn't upload 50x50 Image! <a href='?'>Go back?</a>");[/code] Help?
  9. Lessur

    ?page=

    I want to have something like www.domain.com/?page=pagehere. For example, if I went to my domain.  It would come up on index.php.  And say I have a link to info.  I want to be able to make that link www.domain.com/?page=info.  I also have a link to flash, with, there a link to each persons flash.  I wnat to be able to say www.domain.com/?page=flash&user=usernameofuser .  How can I do such a thing?  I already have all the pages.
  10. Lessur

    ?page=

    Would that code code into my index.php (My home page.)  or Shoudl I make that code index.php and the old index.php index2.php?  Hehe, sorry but Im a newb when it comes to php  :'(
  11. Lessur

    ?page=

    [quote author=businessman332211 link=topic=102191.msg405273#msg405273 date=1154109356] [code]?page=flash[/code] That simply means as I states the ? ends the actual url information and starts the variables the variable page is set to teh word flash $page = flash; is how you would do it, or how it would look in php. this probably tells a redirecting page to send it to the flash version of the site, or could be for something else, or something used in the script to decide whether to activate flash or not.  Could be many reasons. [/quote] So basically, in another page there is $page = flash; ?  And when you say www.blah.com/?page=flash it goes to the page that has $page = flash;  in it?
  12. Lessur

    ?page=

    I dont really understand.  I am talking about for example a site like http://thesmurk.net/.  When you click on "Flash" for example the new address is http://thesmurk.net/?page=flash
  13. Lessur

    ?page=

    I have seen many sites with somethig like: www.domainhere.com/?page=news And then another page like www.domainhere.com/?page=other How can I do that?  ???
  14. I want to be able to say, if $blah == even { echo "";). How can I tell it what even is (like a even number)?
  15. How can I make a code like: <?php if $page == 'blah.php'; { echo "blah";} else{ echo "blahblah"; } ?> Where $page = the page.  Like if you were at login.php wit would be login.php. How can I tell it that $page = the filename of the page?
  16. Ok, I fixed that and did this: [code]$upload2 = dirname($smallimagepath); copy($_FILES['small_image']['tmp_name'],$upload2.$small_image) or die("<br>Error! Couldn't upload 50x50 Image! <a href='?'>Go back?</a>"); [/code] But I am getting "Error! Couldn't upload 50x50 Image!" as an error.  Hmm.
  17. Ok, I have this code: upload.php: [code] $max_filesize = 5000000; $max_imagesize = 20480; $filename=rand(500,2000).$_FILES['file']['name']; $small_image=rand(500,2000).$_FILES['file']['name']; $smallimagepath = "/small_images"; ... elseif ($_FILES['file']['name'] == "") { echo "Field flash file left blank <a href='?'>Go back?</a>"; } elseif ($_FILES['file']['size'] > $max_filesize){ echo "Error! flash file must not be bigger than 5 MB  <a href='?'>Go back?</a>"; } ... elseif(file_exists($upload.$filename)){ echo "Error! File already exists on server, rename and try again. <a href='?'>Go back?</a>"; } elseif ($_FILES['small_image']['size'] > $max_imagesize){ echo "Error 50x50 image must not be bigger than 20k  <a href='?'>Go back?</a>"; } elseif(file_exists($upload.$small_image)){ echo "Error! 50x50 image already exists on server, rename and try again. <a href='?'>Go back?</a>"; } else{ $upload = dirname(__FILE__)."/uploads/"; copy($_FILES['file']['tmp_name'],$upload.$filename) or die("<br>Error! Couldn't upload file! <a href='?'>Go back?</a>"); $size=$_FILES['file']['size']; $upload = dirname($smallimagepath) copy($_FILES['small_image']['tmp_name'],$upload.$small_image) or die("<br>Error! Couldn't upload 50x50 Image! <a href='?'>Go back?</a>"); ..... <input type="file" name="file"> .... <input type="file" name="small_image"> [/code] What I want this to do, is upload the file in the small_image box to directory ' small_images ' and for the ' file '  to upload to uploads.  I also want them to submit their filepath to the database. What it is doing instaed of this is making 2 copies of ' file ' and putting 1 in both ' uploads ' and ' small images '.  It is also submitting the file path to the mysql database under both 'file' and ' small_image ' How can I stop this from happening?
  18. phpBB_setup.php?mode=test_login class=menu?  Where is that file? And was I jupposed to put this code in my login.php file?  Im really confused.
  19. Ok, I am trying to hook the popular phpbb bullitin board system with a uploading system that I created.  I have merged the two databases together, so if someone signs up for phpbb (my forum) they also becsome a member of the uploading system.  Here are my files: Ok, I have a simple script like this: login.php: [code]if ($_GET['submit']){ $username=addslashes(strip_tags($_POST['username'])); $password=addslashes(strip_tags($_POST['password'])); $password_md5=md5($password); $check=mysql_num_rows(mysql_query("SELECT * FROM `phpbb_users` WHERE username = '$username' LIMIT 1")); $check2=mysql_num_rows(mysql_query("SELECT * FROM `phpbb_users` WHERE `username` = '$username' AND `user_password` = '$password_md5' LIMIT 1")); ... session_register('username'); $_SESSION['username'] = $username; session_register('password'); $_SESSION['password'] = $password_md5; echo "You are now logged in with the username $username! <a href='index.php'>Home</a>"; [/code] On other file: [code]<?php if ($_SESSION['username']){ echo " [/code] This, does not work, because phpbb is coding that is out of my knoledge. I will post phpbb's login.php file if it is needed. For those more experianced people here that know how phpbb or a good forum runs, how can I make this work correctly?  ???
×
×
  • 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.