Jump to content

calvin182

Members
  • Posts

    190
  • Joined

  • Last visited

Posts posted by calvin182

  1. I have an array called $db, the keys are filled with date/times and the values are filled with an image name (in this case: header_720x95_01.png). I have the path of the images set as $images.My problem is when I use foreach(), it is adding an additional path of

    http://www.domain.com/folder/gallery/admin/

    infront of the $images.$value2 causing my image source to look like

    http://www.domain.com/folder/gallery/admin/www.domain.com/folder/gallery/images/main/header_720x95_01.png

    . I am thoroughly frustrated with this, can anybody help? Here is the code:

    foreach ($db as $key2 => $value2) {     echo "<img src=\"".$images.$value2."\"/><br/>image: $value2<br/>uploaded: $key2<br/><a href=\"remove.php?key=$key2&value=$value2\" title=\"remove this image\">remove this image</a><br/><br/>";}

    Any help would greatly be appreciated! Thank you :) Ps. sorry about the urls in the code boxes, the long one was getting truncated.

  2. no problem. yea it took me a while but im learning and it was one of those things where you get started and it just bugs you if you dont figure it out, so like i said, no problem.yea i didnt really check over the link to see the application for it, that probably would have helped me fix some of the errors a little easier, oh well, im glad i could have helped :)

  3. alright I figured out how to save an array to a separate file.in this example, the array will be outputed to a file named array.php (make sure you set it's permissions to 777). you will need to create the array.php file (completely blank).1b.php (name it whatever you want):EDIT: because this forum changes ASCII characters, here's a link to the code on my server: http://www.oneity-eight.roxr.com/misc/1b.txtI hope this helps you!Also note that I probably will not keep this file on my server forever, so if the link is down, and your interested in the code, PM me.

  4. so far that's a no... but, reading over the mail() function on php.net, I've made some changes, I remember when I put this script together for my site it didnt work so I had to chage some things depending on the server type. This might work for you:process.php

    <?php$recipient = "name@domain.com";$subject = "Subject of email here";$username = stripslashes($_POST['username']);$password = stripslashes($_POST['password']);$realname = stripslashes($_POST['realname']);$email = stripslashes($_POST['email']);// To send HTML mail, the Content-type header must be set$headers  = 'MIME-Version: 1.0' . "\r\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";// Additional headers$headers .= "To: ".$recipient . "\r\n";$headers .= "From: ".$email . "\r\n";$message = "username: ".$username."<br/>password: ".$password."<br/>realname: ".$realname."<br/>email address: ".$email;if (mail($recipient,$subject,$message,$headers)) {echo "<h4>Your message was sent!</h4><div align=\"center\">Redirecting in 30 seconds<br/><a href=\"index.html\">Or, click here</a></div><div align=\"left\"><br/><br/><strong>recipient:</strong> $recipient<br/><strong>headers:</strong> $headers<br/><strong>subject:</strong> $subject<br/><strong>message:</strong><br/> $message</div><script language=\"javascript\">setTimeout(\"location.href=\'index.html\'\",30000);</script>";} else {echo "<h4>Sending Failure!</h4><div align=\"center\"><a href=\"index.htm\" rel=\"tag\" title=\"Return to form\">Return to form</a><br/><a href=\"index.html\" rel=\"tag\" title=\"Index\">Index</a></div>";};?>

  5. it's not the form. the form has nothing to do with the address it is sent to. you have to set that address in the top of process.php, honestly, I think it's either you didn't set your email address in there or your email host's server is just slow. I suppose there could be a possibility that the server your files are on has somehow disabled the mail function. I really don't know. How about you change your email address in the process.php to mine and I'll see if I get anything from it. I'll send it to you in a PM.

  6. It's works fine for me... I got the message in my gmail account instantly, but... just for the heck of it, lets modify this so we can see if there's an error before waiting forever.process.php:

    <?php$recipient = "name@domain.com";$subject = "Subject of email here";$username = stripslashes($_POST['username']);$password = stripslashes($_POST['password']);$realname = stripslashes($_POST['realname']);$email = stripslashes($_POST['email']);// To send HTML mail, the Content-type header must be set$headers  = 'MIME-Version: 1.0' . "\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";// Additional headers$headers .= "To: ".$recipient . "\n";$headers .= "From: ".$email . "\n";$message = "username: ".$username."<br/>password: ".$password."<br/>realname: ".$realname."<br/>email address: ".$email;if (mail($recipient,$subject,$message,$headers)) {echo "<h4>Your message was sent!</h4><div align=\"center\">Redirecting in 30 seconds<br/><a href=\"index.html\">Or, click here</a></div><div align=\"left\"><br/><br/><strong>recipient:</strong> $recipient<br/><strong>headers:</strong> $headers<br/><strong>subject:</strong> $subject<br/><strong>message:</strong><br/> $message</div><script language=\"javascript\">setTimeout(\"location.href=\'index.html\'\",30000);</script>";} else {echo "<h4>Sending Failure!</h4><div align=\"center\"><a href=\"index.htm\" rel=\"tag\" title=\"Return to form\">Return to form</a><br/><a href=\"index.html\" rel=\"tag\" title=\"Index\">Index</a></div>";};?>

    This is not a fix, it simply will tell you if the message was sent or not, and present you with some link options. From what I understood in your above posts, the form is located on index.htm and you want it to redirect to index.html, so if theres an error you will get links to both of those locations. If the send is sucessfull, you will see a sucess message along with the content of the message and headers, and then the page will redirect in 30 seconds.In my trials, after the 30 second redirect my message arrives in my mailbox. Be sure to set your email address (preferably a gmail address if you have one, they show up in your inbox much faster than yahoo).

  7. 2 hours later I figured this out haha. I've changed a few things but the main error was it was missing a ). Although I don't understand the application of this, here is the fixed version:

    <?php$a = array();$a[1] = "Anna";$a[2] = "Brittany";$a[3] = "Cinderella";$a[4] = "Diana";$a[5] = "Eva";$a[6] = "Fiona";$a[7] = "Gunda";$a[8] = "Hege";$a[9] = "Inga";$a[10] = "Johanna";$a[11] = "Kitty";$a[12] = "Linda";$a[13] = "Nina";$a[14] = "Ophelia";$a[15] = "Petunia";$a[16] = "Amanda";$a[17] = "Raquel";$a[18] = "Cindy";$a[19] = "Doris";$a[20] = "Eve";$a[21] = "Evita";$a[22] = "Sunniva";$a[23] = "Tove";$a[24] = "Unni";$a[25] = "Violet";$a[26] = "Liza";$a[27] = "Elizabeth";$a[28] = "Ellen";$a[29] = "Wenche";$a[30] = "Vicky";$q = strtoupper($_GET['q']);$qlen = strlen($q);if ($qlen > 0) {     $hint = "";     for ($i = 1; $i <= 30; $i++) {          if ($q == substr($a[$i], 1, $qlen)) {               if ($hint == "" ) {$hint = $a[$i];}               else{$hint = $hint." , ".$a[$i];}          }     }}if ($hint == "") {echo "no suggestion";}     else {echo "$hint";};?>

  8. sorry it seems i left my error in the fixed version accidentally, there, copy the last version I posted and it will work :)or if you wanna fix it yourself, change:

    $message = "username: ".$ username."<br/>password: ".$password."<br/>realname: ".$realname."<br/>email address: ".$email;

    to:

    $message = "username: ".$username."<br/>password: ".$password."<br/>realname: ".$realname."<br/>email address: ".$email;

  9. dreamweaver is awesome for xhtml, but anything scripting related like php I would recommed doing in notepad or the code-view of dreamweaver. I do both depending on what I have open.

  10. this might be a good free PHP host for you:http://www.cabspace.com/ ● Instant Activation ● 100MB Disk Space ● 1 Gig/day Bandwidth ● Real 24/7 FTP ● Yourname.cabspace.com Web Address ● Online File Editor / Manager / Usage Stats ● Update or Remove Your Account Through the Profile Manager. ● Custom Control Panel ● Create Unlimited Directories ● Uploaded Files are Immediately Public ● Fast Tier-1 Direct Backbone Bandwidth Connections ● Robust Intel Hardware ● 99.99% Uptime ● Professional Level Support!plus it's ad free! :)

  11. well for starters, on atspace.com, there is nowhere on there that I see "php" listed. does it support php? the server must have it installed.secondly ripway.com supports "asp" and not "php" so I can't help you if you use that.thirdly, if you are certain that your server has php installed, there was an extra space in the process.php script (my spacebar is busted up hehe sorry) so here's the revised version. I tested it this time and it works perfectly.process.php:

    <?php$recipient = "name@domain.com";$subject = "Subject of email here";$username = stripslashes($_POST['username']);$password = stripslashes($_POST['password']);$realname = stripslashes($_POST['realname']);$email = stripslashes($_POST['email']);// To send HTML mail, the Content-type header must be set$headers  = 'MIME-Version: 1.0' . "\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";// Additional headers$headers .= "To: ".$recipient . "\n";$headers .= "From: ".$email . "\n";$message = "username: ".$username."<br/>password: ".$password."<br/>realname: ".$realname."<br/>email address: ".$email;mail($recipient,$subject,$message,$headers);header("location: index.html");?>

  12. the // stuff is just comments. you can post them, they are harmless. everything in that box, just copy it, and save it just like that (except you cange your recipient email address and subject) and save it as process.php.i hope that answers your question. i've subscribed to this thread so if you have any questions or anything ill get an email right away :)

  13. try changing your process.php to this:

    <?php$recipient = "name@domain.com";$subject = "Subject of email here";$username = stripslashes($_POST['username']);$password = stripslashes($_POST['password']);$realname = stripslashes($_POST['realname']);$email = stripslashes($_POST['email']);// To send HTML mail, the Content-type header must be set$headers  = 'MIME-Version: 1.0' . "\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";// Additional headers$headers .= "To: ".$recipient . "\n";$headers .= "From: ".$email . "\n";$message = "username: ".$ username."<br/>password: ".$password."<br/>realname: ".$realname."<br/>email address: ".$email;mail($recipient,$subject,$message,$headers);header("location: index.html");?>

    edit: if youd like I can make it check that the email address is valid and I can a message stating if the mail was sucessfully sent or not.

  14. the only problem i see is the border on the footer of the page in firefox, IE shows it fine however. and there's only one error in your css. if you have the a.small-link font-weight set to none, why even have that attribute set in the first place? here's a list of valid values for font-weight you can use:normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inheritas found at http://www.w3.org/TR/REC-CSS2/fonts.html#propdef-font-weightsorry I don't know my CSS.

×
×
  • Create New...