-
Posts
1,025 -
Joined
-
Last visited
Never
Posts posted by Caesar
-
-
Found a random text file on google and tested this simple code...
<?php $source = file_get_contents('http://www.ccp14.ac.uk/ccp/ccp14/ftp-mirror/nist-texture/test.txt'); $handle = fopen('logs/log_'.time(), "w"); //Assuming you are saving to a folder 'logs' and that it is set to CHMOD '777' fwrite($handle, $source); fclose($handle); ?>
-
It's just a matter of formatting. The input format can be whatever you want, as long as it goes into the database in the correct format (Preferably either a time stamp, or standard date format). You can easily reformat a user's input.
-
Gee willakers.
-
What is display_errors set to, in your php.ini?
-
Check your if/else statements. They're not structured right.
<?php if(This is true) { // Code here. } elseif(This is true) { // Code here. } elseif(This is true) { // Code here. } else { // Code here. } ?>
-
Or I suppose you can take the reverse approach & compare the user's IP to the IP's in your file....
<?php $iprange = file_get_contents('ca_ips.txt'); $userip = $_SERVER['REMOTE_ADDR']; $iparray = explode(".",$userip); if(preg_match('/'.$iparray[0].'\.'.$iparray[1].'\.[0-9]+\.[0-9]+/', $iprange)) { //Do your thang here } ?>
Should work.
-
What do the IP ranges look like (Eg. 72.87.*.*)? Might be able to provide some help with example code if I had an idea of what they were. If anything, give you some ideas. :-)
-
Where is the email being defined? Database? Form?
-
I'll add that you can pretty much do what you want with the values in an array. So yes, you can do what you want. If you defined the keys in the array, you can redefine them.
-
<?php $planes = array('one', 'two', 'three'); unset($planes[1]); ?>
That results in...
Array ( [0] => one [1] => three )
-
Heh...more of an HTML/CSS question.
-
The email address gets passed through the url? Probably not wise. Anyway, have you printed out the $_GET['email'] variable before the mail function just to see if it's there?
-
and the correct layout involves dancing clowns feeding penguins on the moon?
Probably one of the top 5 best posts I've seen on these boards since I signed up :-P
-
Wait....Barand, are you assuming he is storing the dates in a standard format? Don't think he is.
-
That will also work. Though after reading his last reply may want to make the number of days a variable he can define/set based on whatever conditions exist.
-
Also...if you're inserting into a database, it's just good practice to store as either a time stamp, or as a properly formatted date. Makes life easier.
-
<?php $date['today'] = time(); $date['90_days'] = date("d.m.Y",($date['today']+7776000)); ?>
-
When they say they support SSL, they mean, secure paths can be integrated in their settings so that the shop goes through the secure connection when a user proceeds to a certain point in checkout (Rather than simply running under HTTPS). You also want to make sure your server/host allows both incoming/outgoing connections on port 443 (If you plan on using a payment gateway. In other words...steer clear of crap hosts like GoDaddy).
-
If your file already looks like...
URL[1] = "http://google.com/" URL[2] = "http://yahoo.com/"
Then you can try....
<?php $url = explode("\n",file_get_contents($file)); foreach($url as $u) { preg_match('/URL\[[0-9]+\] \= \"([aZ-zZ0-9\_\:\/\.\~]+)\"/i', $u, $links[$i]); $urls[] = $links[$i][1]; $i++; } /* The $urls array will output the following... Array ( [0] => http://google.com/ [1] => http://yahoo.com/ ) */ ?>
-
Interesting thread.
Good luck, buddy.
-
<?php $numrows = mysql_num_rows($result); // Returns the number of records in the query ?>
Fetch row does not work the same way as mysql_num_rows
-
If changing to pages with PHP extensions is not an option, you can tell Apache (Assuming you're a winner and you're not using something horrible like IIS) to parse PHP in html pages. You'll need to make that change server side so you'll need root access.
-
I'm assuming you either are using constants or aren't sure how to define the url.....
<?php function get_image($id) { switch($id) { case '1': $image = 'webmaster.gif'; break; case '2': $image = 'global.gif'; break; } return $image; } $id = $_GET['id']; // This would be the value in http://yourdomain.com/index.php?id=123 $img = 'templates/RBL/images/'.get_image($id); echo '<img src="'.$img.'" order="0" />'; ?>
Possibly something like that....
-
Could you maybe say what problem you're having or paste any errors you're getting so that we don't have to waste time figuring it out? Thanks, buddy.
can anyone hack this site?
in PHP Coding Help
Posted
And speaking of crack....