Jump to content

cudsuk

Members
  • Posts

    21
  • Joined

  • Last visited

About cudsuk

  • Birthday 07/11/1971

Profile Information

  • Gender
    Male
  • Location
    Cambridgeshire , uk.
  • Interests
    Disabled so my young daughter and computers

cudsuk's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok thanks for clearing that up for me
  2. Stooney thanks so much for this ,, will try it , i thought that was weird and was going to google a answer but you beat me to it , i was just looking on the php website at different letters and stuff and checking what functions they perform Getting there slowly
  3. To Christian F. It works as <?= But if you feel <?php echo Is better coding then i am happy to try with that Jessica , thanks for your post also as you are indeed correct also , if i used just <?php = it gave more errors I shall however try Christians any way as like it to be as up to date as i can get it
  4. cheers cpd , but still waiting on my email lmao ,looks like i might need to look at other settings to see why it isn't sending
  5. cheers guys Well here's one then right off the bat if (isset($_GET['op']) && $_GET["op"] == "contact") Is now just (not sure why they did that , got the code from elsewhere) if (isset($_GET['op']) && $_GET['op'] == "contact")
  6. Cheers will take a look Love2c0de Just waiting to see if it did indeed send to my email address now , all i have to do is now add my index page to it so it look slike part of the site Can you just skim over the code above see if can spot anything cheers
  7. Ok i think i have solved it I had it as When sending i got a access violation error , so back to the drawing board Discovered yet more variables needed setting My code is now after a lot of work <?php // Change these two variables to meet your needs. $myemail = 'myemail@gmail.com'; $subject = 'Change this contact subject'; if (isset($_GET['op']) && $_GET["op"] == "contact") { $name = stripslashes($_POST[name]); $email = stripslashes($_POST[email]); $text = stripslashes($_POST[text]); $referrer = $_POST[referer]; $remote_host = $_SERVER[REMOTE_ADDR]; $server = $_SERVER[sERVER_NAME]; $browser = $_SERVER[HTTP_USER_AGENT]; if(!preg_match("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$",$email)) { if (!empty($status)) { $status = "We're sorry, but you've entered an incorrect email address.<br>"; } } if(!$name) { if (!empty($status)) { $status .= "Please enter your name.<br>"; } } if(!$text) { if (!empty($status)) { $status .= "Please enter a message.<br>"; } } if (!empty($status)) { if(!$status) { $header = "From: $emailrnReply-To: $emailrn"; $message = " Name: $name Referer: $referer Site: $server Remote Host: $remote_host Remote Browser: $browser $text "; if(mail($myemail, $subject, $message, $header)) { if (!empty($status)) { $status = "Thank you for your Feedback!!<br><br>"; } } else { if (!empty($status)) { $status = "There was a problem sending your feedback, please try again later.<br><br>"; } } } else { if (!empty($status)) { $status .= "Please press <u>back</u> on your browser to resubmit.<br><br>"; } } } } // Now check the referer page and ensure it's a proper URL $referer = $_SERVER['HTTP_REFERER']; if(!preg_match('#^http\:\/\/[a-z0-9-]+.([a-z0-9-]+.)?[a-z]+#i', $referer)) { unset($referer); } ?> <?php if (!empty($status)) { print $status; } ?> <form method="post" action="<?php if (!empty($_SELF)) { print $_SELF; } ?>"> <input type="hidden" name="op" value="contact"> <input type="hidden" name="referrer" value="<?php print $referer; ?>"> Name<br><input name="name" size="35" value=""><br> E-mail address<br><input name="email" size="35" value=""><br> <br>Message<br><textarea name="text" cols="50" rows="10"></textarea><br><br> <input type="submit" value="Send message!"> </form> I had to make changes like this for it to work <form method="post" action="<?php if (!empty($_SELF)) { print $_SELF; } ?>"> Happy now as i have It appears to work as well now , no errors given , just have to log into my email now and see if i have a test post , can someone just check over my code and tell me if see any other errors ? Thanks for the help seems i might be able to do this php thing after all if pointed to the right place to look ?
  8. I aploigise for posting again but it won't let me make a edit after i have done so already Ok , after some googling i discover using isset checks if a variable is set , i changed my code with the help of haku's post So mine is now if (isset($_GET['op']) && $_GET["op"] == "contact") this resolves my error but yet again , i now have a new one Notice: Undefined variable: status in C:\xampp\htdocs\videos\contact.php on line 72 that line is <?php print $status; ?> So i am guessing i have to define that as well now ? Can someone just tell me if code i placed is ok , or have i completely messed it up , hence why i get this , or just the fact that the code i am using is so old and needs a major reworks , i am starting to understand i think that all commands can't be null they have to be assigned as such to work , but my knowledge is 0 Am i at least on the right track ? I won't post no more until i solve this as don't want to get a warning for posting to much , cheers
  9. Won't let me edit the line above but <br> is there as i believe is uded in html as a line break durrrrrrr , if i put a ) after if(isset($_POST['op'])) it goes to end but since no close as such i get this , i am struggling a bit , please help Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\videos\contact.php on line 87
  10. HI cpd , yes i did copy and paste but from notepad++ the <br><br> would not be in my code just here as it does that when pop it in code tags Ok i am led to believe as a } bracket or a semi colon is missing , but maybe i am way of the mark , i am a total novice , so a easy mistake for you to spot but over my head , i will do as you suggest and look at the parenthesis and trial and error it , thanks EDIT ok is due to having a if($op == 'contact') { { but not a } before it yes ? , so i have to discover where to place it to work as one would open the command as such and the other close it ? Sorry for being a total noob , but got to start somewhere
  11. lmao , point taken as explained is very old code , at least i was on the right tracks as such , i just needed to see how it looked , Ha ha i guess above would only apply in china to lady boys lol Damn now getting Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\videos\contact.php on line 9
  12. For those not aware , i am just starting out and trying to learn to solve errors by getting hints or tips , not actually looking for you to do it fo rme as such or i will never learn but i appreciate the help I have a old script that is about 7 years out of date i need to update and it is throwing up a error of Notice: Undefined index: op in C:\xampp\htdocs\videos\contact.php on line 8 Notice: Undefined variable: status in C:\xampp\htdocs\videos\contact.php on line 74 The code is <?php // Change these two variables to meet your needs. $myemail = 'whatever@gmail.com'; $subject = 'my site'; $op = $_POST['op']; if($op == 'contact') { $name = stripslashes($_POST[name]); $email = stripslashes($_POST[email]); $text = stripslashes($_POST[text]); $referer = $_POST[referer]; $remote_host = $_SERVER[REMOTE_ADDR]; $server = $_SERVER[sERVER_NAME]; $browser = $_SERVER[HTTP_USER_AGENT]; if(!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$",$email)) { $status = "We're sorry, but you've entered an incorrect email address.<br>"; } if(!$name) { $status .= "Please enter your name.<br>"; } if(!$text) { $status .= "Please enter a message.<br>"; } if(!$status) { $header = "From: $emailrnReply-To: $emailrn"; $message = " Name: $name Referer: $referer Site: $server Remote Host: $remote_host Remote Browser: $browser $text "; if(mail($myemail, $subject, $message, $header)) { $status = "Thank you for your Feedback!!<br><br>"; } else { $status = "There was a problem sending your feedback, please try again later.<br><br>"; } } else { $status .= "<br>Please press <u>back</u> on your browser to resubmit.<br><br>"; } } // Now check the referer page and ensure it's a proper URL $referer = $_SERVER['HTTP_REFERER']; if(!preg_match('#^http\:\/\/[a-z0-9-]+.([a-z0-9-]+.)?[a-z]+#i', $referer)) { unset($referer); } ?> <?php print $status; ?> <form method="post" action="<?php print $_SELF; ?>"> <input type="hidden" name="op" value="contact"> <input type="hidden" name="referer" value="<?php print $referer; ?>"> Name<br><input name="name" size="35" value=""><br> E-mail address<br><input name="email" size="35" value=""><br> <br>Message<br><textarea name="text" cols="50" rows="10"></textarea><br><br> <input type="submit" value="Send message!"> </form> Line 8 is [/b] $op = $_POST['op']; line 74 <?php print $status; ?> Looking around and reading posts here , op is not used ? it is if ($_POST[op] ? or use isset ? Can someone please explain how to change it so it works as i am certainly not a coder , but am i on the right track , i believe it is something about an array not being set first or something ? Thanks for the help i appreciate it , i have managed to solve one other problem already by a kind member saying use so and so , but not saying where or how lmao , if i don't do trial and error i am never going to learn , so thanks if you can help out Edit I think i have spotted another error in this , isn't if(!eregi suppose to be if(!preg_match ?
  13. Thanks Jazzman - i use to have sites before which was on a linux vps and yes i had to get a proper domain name , i know people who have used a localhost before but i thought maybe they got away with using a dns forwarder Seems like to do it properly i might have to get a proper domain name then ? At moment i am just using a normal win 7 pc but it has 4 gigs ram and a 1Tb hard drive , i was trying to save some money as skint but needs must lol Thanks for the help - my ip is static it never changes so i guess something like noip is no good as don't want to use there url really , i was using one from co.nr
  14. Ok , thanks for the <?php tip I didn't place it everywhere i did a trial and error and i was half right with asking the question above Doing this lost the code , but i also lost my info in blocks for links , top rated , media stats <?php if (! isset($_SESSION['LOgIn'])) { ?> <form action='<?=$siteurl?>/login.php' method='post' name="login" ><br> <input type="text" name="username" value="username" class="log_input" size="20"><p> <input type="password" name="password" value="password" class="log_input" size="20"> <p align="right"> <input type="image" src="<?=$siteurl?>/images/login.gif" name="login" value="login" class="log_btn" /></p> </form> <?php } To fix it i was right needed to go in front of include else { echo '<p align="center" style="font-weight:bold;color:white;"><span>Welcome '.$_SESSION['LOgIn'].'</span></p>'; echo '<p> <a href="'.$siteurl.'/profile.php?show_favorites='.$_SESSION['LOgIn'].'" class="lilogin"> visit your profile</a><br>'; echo ' <a href="'.$siteurl.'/logout.php" class="lilogin"> log out</a></p>'; } ?> </div><img src="<?=$siteurl?>/images/log-bottom.gif" alt="border bottom" /><div class="leftcol-top">Top Rated Media</div> <div class="leftcol-div"> <p><?php include "stat_toprated.php"; ?></p> </div><img src="<?=$siteurl?>/images/leftcol-bottom.gif" alt="border bottom" /><div class="leftcol-top">Categories</div> <div class="leftcol-div"> <?=get_categories_list($siteurl)?> </div><img src="<?=$siteurl?>/images/leftcol-bottom.gif" alt="border bottom" /><div class="leftcol-top">Links</div> <div class="leftcol-div"> <?php include "links.php"; ?> </div><img src="<?=$siteurl?>/images/leftcol-bottom.gif" alt="border bottom" /><div class="leftcol-top">Media Stats</div> <div class="leftcol-div"> <p><?php include "stat_total_games.php"; ?></p> <p><?php include "stat_whos_online.php"; ?></p> </div><img src="<?=$siteurl?>/images/leftcol-bottom.gif" alt="border bottom" /> </td> <td class="rightcol"> <?php include('ads_top.php'); ?> <?=$news_content?> <?=$content?> <?php include('ads_second_top.php'); ?> </td> </tr> </table> <div id="bottom"><img style="float:left;" src="<?=$siteurl?>/images/f-left.gif" alt="bottom left" /><div id="footer" align="center"><a href="http://toonfreaks.co.nr">© 2013 toonfreaks.co.nr</a></div><img style="float:right;" src="<?=$siteurl?>/images/f-right.gif" alt="bottom right" /></div> </div> </body> </html> So thanks guys , i guess this is my first lesson , get a tip and d.i.y , cheers for the support and help
  15. ok i will try to explain it a little better , i am using a home pc via xampp and my router , i have set it up so it port forward on port 80 so apache is port 80,443 and mysql is 3306 my files are in c:/xampp/htdocs/videos/ I set up a port forward dns ie mysite.com to my isp address like so http://000.000.000.00/videos/ so my url would be mysite.com and it points to my ip adress and folder i have my files in , i can do either localhost/videos/ for testing only http://000.000 etc /videos/ to make sure working online or mysite.com and all is ok , i will see the site however if i do the mysite.com i don't get my images to display properly there broken links If i use my ip as my url they work fine , i hope that is making sense ? I am asking if i need to do anything to set it up correctly , like change my htaccess file or maybe my host file even If i say one of you guys to type in mytoons.com i want it to go there and work properly , not to display my ip address as such Sorry for it being long winded but wanted to explain it better and clearly , hope you can understand now ? Thanks EDIT I am such a idiot , christian i understand what you mean , yes i am testing it using the same ip as the site would be directing too , i should use my phon ewith wifi turned off i guess no wonder i am having issues , luckily i asked you guys as i still need to know what my proper url would be ?
×
×
  • 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.