
Danltn
Members-
Posts
14 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
Danltn's Achievements

Newbie (1/5)
0
Reputation
-
xml from a url importing in to a mysql database
Danltn replied to ldoozer's topic in PHP Coding Help
PHP only has the SOAP library installed in PHP 5+ (although there are workarounds.) Seriously though, upgrade that PHP. PHP 4 was released in 2000, PHP 5 was released in 2004. Dan -
Hey there, I need people to test out my Screenshot class for PHP. Any help is thoroughly appreciated, although I must warn you it has really particular tastes in systems. You can find it at http://www.phpclasses.org/browse/package/4608.html along with an example or two. Any problems, please do post here. Any code improvements are really welcome too! (I know some parts are written a little weirdly, if you could help me iron it out it would be great!) Thanks, Dan
-
How to strip quotes (single and double) from a string in PHP
Danltn replied to jwhite68's topic in PHP Coding Help
Wouldn't str_replace do this? -
include 'otherpage.php'; include_once 'otherpage.php'; require 'otherpage.php'; require_once 'otherpage.php';
-
<?php $ip = $_SERVER['REMOTE_ADDR']; $ips = explode(".", $ip); if($ips[0] == 130) { header('Location: http://127.0.0.1:8888'); // Change 127.0.0.1 to the relevant one } else { echo "You are not located on campus. If you wish to listen to streaming music, please use VPN then try again."; } exit; ?> That works fine for me. You could try purchasing a cheap .US/com/net domain, and putting the script on there with the hosting you get. (No more than $10)
-
<?php include("FILE.php"); ?> Notice the <?php <- Php
-
Here's a good one: Change the top line to your email. Then open the file in your browser (once uploaded) <?php $myemail = '[email protected]'; ?> <head><style> body { margin:0px;padding:0px;text-align:center; } #mail { margin-left:20px; } #borat { position: absolute; right: 0; bottom: 0; } #thanks { font-size:24; } #lines { margin-bottom:5px; } a { color:black; } a:link { color:black; } a:hover { color:black; } a:visited { color:black; } a:active { color:black; } </style></head> <body> <?php $pageUR1 = ereg_replace("/(.+)", "", $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]); $pageURL = str_replace("www.", "", $pageUR1); ?> <!-- <div style="position:absolute;top:0;left:0;height:98%;width:98 %;margin:1%;padding:0px;background-color:#C9F9F9"> --> <div style="text-transform:capitalize;height:90px;background-color:#F9F9F9;font-size:72px;padding:5px;text-align:center;"><?php echo $pageURL; ?></div> <div id="mail"> <?php $subject = "Message from $pageURL"; $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 = $pageURL; $browser = $_SERVER[HTTP_USER_AGENT]; if(!$name || !$text || !$email) { echo "<img src=\"http://neville.tk/form/smiley.gif\" style=\"margin-bottom:15px;\">"; } if(!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$",$email)) { $status = "<div id=\"lines\">Whao dude - That ain't cool! You <em>SO</em> entered an invalid email!</div>"; } if(!$name) { $status .= "<div id=\"lines\">Hey mate, I wanna know your name! I know you have one</div>"; } if(!$text) { $status .= "<div id=\"lines\">So you thought you'd just come, and not leave a message? Foo!</div>"; } if(!$status) { $header = "From: \"$name\" <$email> \n"; $message = " Name: $name Referer: $referer Site: $server Remote Host: $remote_host Remote Browser: $browser $text "; if(mail($myemail, $subject, $message, $header)) { $status = "<div align=\"center\" style=\"margin-bottom:15px;\"><img src=\"http://neville.tk/form/happy.gif\"></div>"; $status .= "Thanks $name - I have like <em>TOTALLY</em> received your mail.<br /><br />Wanna send me <a href=\"" . $_SERVER['SCRIPT_NAME'] . "\">another</a>?"; $topleft = "<div id=\"borat\"><img src=\"http://mf1.us/bulklist/borat.png\"></div>"; $firstcom = "<!--"; $secondcom = "-->"; } else { $status = "There was a problem sending your feedback, please try again later.<br><br>"; } } else { $status .= "<div id=\"lines\">I totally can't believe you did that, try again below or press <u><a href=\"\" onMouseover=\"history.go(-1)\">back</a></u>.</div><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); } ?> <div id='thanks'> <?php echo $status; echo $topleft; echo $firstcom; ?> <form method="post" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>"> <input type="hidden" name="op" value="contact"> <input type="hidden" name="referer" value="<?php print $referer; ?>"> <div style="margin-top:10px;"><label for="name" style="font-size:24px;">Name:</label></div> <input name="name" size="35" style="padding-left:0;margin-left:10px;font-size:24px;width:90%;text-align:center;"> <div style="margin-top:10px;"><label for="email" style="font-size:24px;">Email:</label></div> <input name="email" size="35" style="padding-left:0;margin-left:10px;font-size:24px;width:90%;text-align:center;"> <div style="margin-top:10px;"><label for="text" style="font-size:24px;">Message:</label><br /><textarea name="text" style="padding-left:0;margin-left:10px;height:200px;width:90%;font-size:24px;font-weight:700;"></textarea><br /> <div style="margin-top:10px;"><input type="submit" value="Send message!" style="font-size:24px;"></div> </form> <?php echo $secondcom; ?> </div> </div> </body> </html>
-
RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /dir/page.php?ec==$1 // Edit this line
-
Could you please visit http://mf1.us/ip/flag.gif and reply back what flag appears, and also what country your in. If you get a "?" please still reply back saying so, don't forget to say what country. E.G. Flag: US Current Country: US Flag: Current Country:
-
It still works. Try implementing this. $usernamefinal=str_replace("<", "", $username);
-
Preferred way if (function_exists('curl_init')) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); return curl_exec($ch); } else { return file_get_contents($url); }
-
RewriteEngine On RewriteBase / RewriteRule _ /404document.php [QSA,L] ErrorDocument 404 /404document.php
-
You could grab their data if you used a PHP script correctly. - But I very much doubt they provide an API at all, and if they do it's very unlikely to be PHP.
-
This is spot on for what you need as long as your host as the required module and allows you to change them. I advise you put this in your public_html file