Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. Also if you are creating an image it is pointless having any HTML in the file that is creating the image. As you cannot create an image and use html or any other text at the same time. So remove all html.
  2. Change: stripcslashes($albhed]) to: stripcslashes($_GET['albhed']) And chnage: stripcslashes($albhed]2) to: stripcslashes($_GET['albhed2'])
  3. Intresting! I have tried your script and it works fine for me. I have no idea what else might be the problem. This is the code I used: [code]<?php // check that cookie hasnt been set if(!isset($_COOKIE['user_id'])) {     // set the cookie     setcookie('user_id',1,mktime(0, 0, 0, 12, 32, 2030));     echo "Cookie has been set. Refresh the browser window"; } else {     // get the cookie     echo "Retrieving cookie...<br />\n";     echo $_COOKIE['user_id']; } ?>[/code]
  4. You wait around! You've only given it 45 minutes atleast wait for about 2-3 hours first. You'll probably find no one understand what you are trying to do or how to help as what you asking maybe out of our members expertise. I think I know what the problem is chnage this: <a href= "http://localhost/Yanivs/MMO-Date/Activation.PHP?' .$checkbig'">http://localhost/Yanivs/MMO-Date/Activation.PHP?<a>'; to the folloiwng <a href= "http://localhost/Yanivs/MMO-Date/Activation.PHP?' .$checkbig [!--coloro:red--][span style=\"color:red\"][!--/coloro--][b].[/b][!--colorc--][/span][!--/colorc--] '">http://localhost/Yanivs/MMO-Date/Activation.PHP?<a>'; You was missing a dot thats all. Also you make sure you have defined in your email header that the the content is html. Otherwise your hml will be displayed as normal text.
  5. You sure its this script? As I get no errors.
  6. Whats your question? I doen't matter if its a dumb butt question. Its what we are here for.
  7. Yes that is correct.
  8. $mail needs to be $_POST['email'] On this line: if( !preg_match('|^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z0-9]{2,4}$|i', [!--coloro:red--][span style=\"color:red\"][!--/coloro--][b]$mail[/b][!--colorc--][/span][!--/colorc--])) The red text is what needs to be changed to $_POST['email']
  9. From looking at [a href=\"http://dev.mysql.com/doc/refman/5.0/en/temporary-table-problems.html\" target=\"_blank\"]Temporay Table lmitations[/a] over at mysql.com it looks you can create multiple temporay tables.
  10. If you want to get each line seperatly you'll need to use explode, like so: $content[1] = explode("\n", $content[1]); Now each line will be in its own array you'll this: $content[1][x] x being the line number. But rememeber arrays start at zero. SO if you want line 5 you'll need to replace x with 4 like so: $content[1][4] // line5 Hope that helps. Also you can use a foreach loop to do the dirty work for you to get each line, like so [code]foreach($content[1] as $key => $value) {     echo "\$content[{$key}] = \"$value\"<br />\n"; }[/code] Then if you want to get the Pet, Owner and address on their own use the following in your foreach loop instead: [code]foreach($content[1] as $key => $value) {     ($pet, $owner, $address) = explode("|", $content[1][$key]);     echo $owner . ' has a ' . $pet . ' which lives at ' . $address; }[/code] Hope that helps.
  11. You can get th for loop to work by adding -1 after the count function, like so: [code]for ( $a = 0; $a < count( $array)-1; $a++ ) { // } [/code] The key here is the use of -1, as the count will say there are five values in the array. Burt as arrays start from zero we need to subtract one form what count returns. Now the for loop will work.
  12. Okay from looking at the comments from the script. Make sure you have set the CHMOD permission for blockip.txt to 0755. You may need to create this file first and then set the permissions. When you set the correct permissions for the file your script should work fine. Here is where I go this information from: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]# To block an IP, simply add it to the blockip.txt text file. # CHMOD 777 the blockip.txt file (run "CHMOD 777 blockip.txt", without the double quotes) # This is needed because the script tries to block the IP that tried to hack it[/quote]
  13. Make sure you dont have the setting "[i]Delete new cookies when exiting Opera[/i]" is ticked. You can check this by going to Tools -> Preferences Avanced Tab -> Cookies Thats the only thing I ahve come up as to why Opera is deleting the cookie.
  14. Your best of with adding the errors to an array, then at the end check whether there is any errors. If there are echo them out. Like so: [code]<?php // check that the form has been submitted: if(isset($_POST['submit'])) {     // define our error variabled     $error = '';     if(isset($_POST['name']) && empty($_POST['name']))     {         // if the name fieled was not filled in, we add the following to our error array         $error[] = "You have not provided a name. Please enter a name";     }     if(isset($_POST['email']) && empty($_POST['email']))     {         // if the email fieled was not filled in, we add the following to our error array         $error[] = "Please provide an email address";     }     if(isset($_POST['message']) && empty($_POST['message']))     {         // if no message was entered, we add the following to our error array         $error[] = "You have not provided an message for your email";     }     // now we check whether our error variable is an array     if(is_array($error))     {         echo "Please correct the following errors:\n<ul>\n";                          // now we loop through our error array and display any errors:         foreach($error as $key => $value)         {             echo '<li>' . $value . "</li>\n";         }         echo "</ul>\n";     }     else     {         // no error was detected continue on     } } ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">   Name: <input type="text" name="name" value="<?php echo isset($_POST['name']) ? $_POST['name'] : '' ?>" /><br />   Email addtress: <input type="text" name="email" value="<?php echo isset($_POST['email']) ? $_POST['email'] : '' ?>" /><br />   Message: <textarea name="message"><?php echo isset($_POST['message']) ? $_POST['message'] : '' ?></textarea><br />   <input type="submit" name="submit" value="Submit" /> </form>[/code]
  15. Just get rid of the td tags altogether. If you want to move the flash animation use CSS to move it.
  16. You can also specify valign="top" in the tr tags too which will valign every td cell to the top too. But CSS is much better.
  17. Try using return instead. echo sends the output to the browser, where as return returns the value, rather than echoing.
  18. Use htmlentities, function ie: [code]$str = '<a href="http://www.mypage.com/index.php?id=<?php echo"$id";?>"<img src="http://www.mypage.com/bnt-logo.png"></a>'; echo htmlentities($str);[/code] Also how is <?php echo"$id";?> going to work? How is the $id variable going to be set on the other persons site they post it on?
  19. To insert data inot the database use the followng query: [!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']INSERT[/span] [color=green]INTO[/color] [color=orange]table_name[/color] (column1, column2, ...) VALUES (column1_value, column2_value, ...) [!--sql2--][/div][!--sql3--] For updating a database use the following query: [!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']UPDATE[/span] table_name SET column_name[color=orange]=[/color]some_new_value [color=green]WHERE[/color] some_col[color=orange]=[/color]some_value [!--sql2--][/div][!--sql3--] For your third question, you want to look into the MAX mysql function. Also here are a few turtorials on SQL Syntax: [a href=\"http://www.php-mysql-tutorial.com/\" target=\"_blank\"]http://www.php-mysql-tutorial.com/[/a] [a href=\"http://www.w3schools.com/sql/sql_intro.asp\" target=\"_blank\"]http://www.w3schools.com/sql/sql_intro.asp[/a] [a href=\"http://www.tizag.com/mysqlTutorial/\" target=\"_blank\"]http://www.tizag.com/mysqlTutorial/[/a]
  20. WHen you post your code, place a space between the function name and the open ( brace like so: [code]functionName (... blah ...);[/code] ot then allow you to post. Its a security script that cause this it thinks you are attacking the site.
  21. The { and } are used to basically help PHP out, otherwise it'll get confused. So if the code was this: $d->urldecode($key) = $this->urldecodeRecursively($val); PHP will try to called a function called urldecode inside the stdClass. Which probably doesnt exist and end up causing an error! But we want to use a pre-defined PHP function called urldecode instead. So we use the curly brakets to define the function we want to use. The same applies to this code: $d->{$key} = $this->urldecodeRecursively($val); But instead of calling a function we want to use the [b]value[/b] of the $key variable. So if $key was set to [b]SomeVar[/b], $var will be replaced with its value when it is parsed like so: $d->[i]SomeVar[/i] = $this->urldecodeRecursively($val); Hope that helps. Basically { and } are used to define functions/variables
  22. When you submit a form the data you inputted into the form fileds/components is sent, you cannot send the forms html with it! The action attribute, which should be in the form tag, defines where the submitted data will be sent to. The script in which it gets sent to is where the data should be processed. It is your responsibility how that data is processed and presented. Yes you can email the data submitted, but you have to layout how the email will look.
  23. Umm, no offense but could you put that in english? And explain in more detail about what you are trying to achive.
  24. You can just put this in your customer php.ini: allow_url_fopen = On It may work, it may not. I would expect godaddy probably limits what settings you can changes in your custom php.ini
  25. I'd use the id field if you have set one up, rather than ordering by date. adn you'll want to use this: ORDER by `post_id` DESC About your pages thing you'll probably want to change this: [code]if ($offset < 1000) {[/code] to the following: [code]if ($offset < $pages) {[/code] $pages is the variable you setup for the max number of pages. Also you might want to chnage this: [code]$count = mysql_num_rows($result); for ($i = 0; $i < $count; $i++) { $row = mysql_fetch_array($result);[/code] to the following: [code]$count = mysql_num_rows($result); if($count < 1) {     echo "No entries in guestbook" } else {     while($row = mysql_fetch_array($result);     // rest of your guestbook code here }[/code]
×
×
  • 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.