-
Posts
3,584 -
Joined
-
Last visited
-
Days Won
3
Everything posted by JonnoTheDev
-
You cannot. Separate the page into parts and apply background images to them <div id="part1"></div> <div id="part2"></div>
-
The sessionId should be stored in the file you specify for cookies in this case /tmp/cookies.txt curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookies.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
-
Try SELECT e.user_id, e.home_id, u.user_name AS user1, h.user_name AS user2 FROM EntryTable e INNER JOIN UserTable u ON(e.user_id = u.user_id) INNER JOIN UserTable h ON(e.home_id = u.user_id)
-
SELECT u.user_name, e.* FROM UserTable u INNER JOIN EntryTable e ON (u.user_id = e.user_id AND u.home_id = e.home_id)
-
A much cleaner method. <?php preg_match_all('/(shit|piss|fuck|cunt|cocksucker|motherfucker|tits)/', $comment, $result); if(count($result[1])) { // bad words found print "Rinse your mouth out"; } else { // no bad words print "You are a good boy"; } ?>
-
In what way? Your code below just deletes a database record unless i'm missing something. One thing I noticed is that you are comparing the session id against a URL paramater. Passing this value through the url is a bad idea. $_GET['Auth'] == session_id()
-
You first job is to find a payment provider i.e PayPal, Worldpay, etc Each provider offers different types of services. You may want to take credit card details on your own site and send the data to a payment service (requires a merchant bank account and can be a long process getting approval) or simply have a button that directs a user to a payment gateway where they enter their payment details. Once you have a provider then look at their documentation on how to integrate their services into your website.
-
SELECT u.user_name, e.* FROM UserTable u INNER JOIN EntryTable e ON (u.user_id = e.user_id)
-
Heres the colour codes http://www.linux.com/archive/articles/113860 $output = "Hello World\n"; print "\033[31m".$output; Should be really easy to write a function. I use the above to print red text. I then use the following function to clear the screen so you get a blink effect when a process is going through a loop i.e. Cleaning database records. function clearscreen() { $clearscreen = chr(27)."[H".chr(27)."[2J"; print $clearscreen; }
-
How can I convert html file/string to image??
JonnoTheDev replied to c815902's topic in PHP Coding Help
Ah, I see This shouldnt be too difficult then. You could either use php's native graphics functions or my choice would be to use Imagemagick (may need to install on your server) http://www.imagemagick.org/script/index.php If you use the GD libraries in PHP then go through this tutorial http://www.thesitewizard.com/php/create-image.shtml -
With the IPN you don't generate buttons. You will need to build the form yourself. Read the paypal documentation or speak to your account manager. You will create a php script on your server that paypal will request when a payment is being processed. This will update your database. Again read the documentation or look at the code examples to do this. It is a little tricky to setup for the first time but once you have read the docs you will understand better.
-
How can I convert html file/string to image??
JonnoTheDev replied to c815902's topic in PHP Coding Help
This cannot be achieved using server side php. To screen grab HTML output would require a broswer interface and a screen print function. php could be used to collect the data required i.e websire urls however another technology would be required to screen capture the websites and save as images. Mozilla Firefox has an add on to achieve this https://addons.mozilla.org/en-US/firefox/addon/1146 -
[SOLVED] Code to recognize digits within a number string
JonnoTheDev replied to njdirt's topic in PHP Coding Help
Really? The word 'database' means storing data? LOL -
Thats not really what you asked for However you will need 2 loops. One for the first 12 and another for the rest <ul class="pics"> for($x = 0; $x < 12; $x++) { } </ul> <ul class="pics2"> for($x = 12; $x <= (count($cats)-12); $x++) { } </ul>
-
[SOLVED] Code to recognize digits within a number string
JonnoTheDev replied to njdirt's topic in PHP Coding Help
Nothing mentioned about storing post data but data correspondence You mentioned exploding a string to an array by using a separator. This requires modification to the form to include the separator as the value. How can I split the string 123? does it consist of three digits 1,2,3 or two 12,3 ? By using the correct data type in the first place will eliminate the need to split anything. -
[SOLVED] Code to recognize digits within a number string
JonnoTheDev replied to njdirt's topic in PHP Coding Help
What you should have done is give the field a name of an array type to hold multiple values i.e. If I have 3 checkboxes <input type="checkbox" name="foobar[]" value="1" /> <input type="checkbox" name="foobar[]" value="2" /> <input type="checkbox" name="foobar[]" value="3" /> Then I can get at the selected values using array functions <?php print_r($_POST['foobar']); ?> -
[SOLVED] Age range based on Data of Manufactor
JonnoTheDev replied to Canman2005's topic in PHP Coding Help
SELECT * FROM tablename WHERE datecreated >= DATE_SUB(CURDATE(), INTERVAL 15 YEAR) AND datecreated <= DATE_SUB(CURDATE(), INTERVAL 10 YEAR) -
That would have resulted in an error!
-
Go for it. Post you link. You are only going to get the truth posted back. May lead to a lot of work for you though!
-
Nesting p tags is invalid. The second example also has a h1 tag. This will be pushing the content down. You are missing in your example with php. This issue has nothing to do with php as you are only printing html. It is purely CSS and HTML. Try copying this in. <?php echo "<h1>Header</h1>\n<p>hi</p>"; ?> Also missing <div id="footer_container">FOOTER</div>
-
Ammend to fit your database <?php // get last 70 records $result = mysql_query("SELECT name, image FROM tablename ORDER BY id DESC LIMIT 70"); $counter = 1; while($row = mysql_fetch_assoc($result)) { // if counter < 12 display image else print name print (($counter < 12) ? "<img src='".$row['image']."' /><br />" : $row['name']."<br />"); $counter++; } ?>
-
Simple. Your second example has the main content enclosed within <p> tags. Try <?php echo "<p>hi</p>"; ?> Cetanu, you can see the output being echoed in the screenshots provided.
-
Simple. Your second example has the main content enclosed within <p> tags. Try <?php echo "<p>hi</p>"; ?>
-
Look at the ftp functions that php has http://uk.php.net/ftp