![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
zq29
-
Posts
2,752 -
Joined
-
Last visited
-
Days Won
1
Posts posted by zq29
-
-
You could use ereg() in your processing script, maybe something like:
[code]if(ereg("[0-9]*\.[0-9]{2}",$amtpaid)) echo "Everything is OK";[/code]
If you want to do this prior to your processing, you'd need to use a client side language, such as JavaScript. -
Have you tried this?
[code]$id = $_GET['id'];[/code] -
I don't fully understand what you mean by 'embed' a file into a page. You can use include() to insert another scripted/plain text file within your page...
With regards to your URL structures, you can do that with an Apache module called mod_rewrite, searching the forums or checking out the documentation over at apache.org should help you out with that. -
How are you setting the variables? Somehow you are creating them as arrays. You can view the structure of your arrays with something like...
[code]<?php
echo "<pre>";
print_r($array);
echo "</pre>";
?>[/code] -
You could use [url=http://www.php.net/imagecreatefromjpeg]imagecreatefromjpeg()[/url]
All of the GD functions can be found at php.net/gd for future reference! :) -
Here's an example from the manual, using the function imagettftext() :
[code=php:0]<?php
// Set the content-type
header("Content-type: image/png");
// Create the image
$im = imagecreatetruecolor(400, 30);
// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 399, 29, $white);
// The text to draw
$text = 'Testing...';
// Replace path by your own font path
$font = 'arial.ttf';
// Add some shadow to the text
imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
// Add the text
imagettftext($im, 20, 0, 10, 20, $black, $font, $text);
// Using imagepng() results in clearer text compared with imagejpeg()
imagepng($im);
imagedestroy($im);
?>[/code] -
You could run phpinfo() on both servers and compare them that way.
-
An SMTP server is your outgoing mail server, you normally get a mailserver along with your web hosting package and domain name, it is usually something like mail.your-domain.com or smtp.your-domain.com. If you don't currently have any hosting and just want to send mail from your local machine, you can normally use your ISPs outgoing mail server. You'd have to ask your ISP what this is, either give them a call, look on their site or in any documentation you got when you signed up for your internet subscription.
-
I've actually brought this up in our admin forum! I didn't know you can use PHP tags though! Also, if you put the <?php and ?> between code tags you get colour coding... But yeah, it is too small!
[code]<?php
function count_to_one_hundred() {
for($i=1; $i<=100; $i++)
echo $i."<br/>";
}
count_to_one_hundred();
?>[/code] -
It's perfectly fine to use echo, although you must be careful with your quotes, you must escape double quotes if your text is enclosed in double quotes, or replace them with single quotes.
[code]<?php
//This is correct
echo "Hello, my name is 'Kris', pleased to meet you.";
//This is also correct
echo "Hello, my name is \"Kris\", pleased to meet you.";
//This is incorrect
echo "Hello, my name is "Kris", pleased to meet you.";
?>[/code]
An alternative would be to use the HEREDOC syntax, you can see how to use it [url=http://uk.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc]here in the manual[/url]. -
You need to match it against a field in the database, for example:
[code]$query = "SELECT Quantity FROM Enquiries WHERE measurement = '$A4'[/code] -
There's a section in your php.ini that looks like this:
[quote][mail function]
; For Win32 only.
SMTP = mail.my-domain.co.uk ; for Win32 only
; For Win32 only.
sendmail_from = mail@my-domain.co.uk ; for Win32 only[/quote]
You just need to point those at your SMTP server. -
[quote author=wildteen88 link=topic=98971.msg389553#msg389553 date=1151658529]
Hi SA. To chnage you signatur you need to got your Profile then goto Account Related Settings and you find a box that says member group. Change that to Global Moderator, then at the bottom theres a password box. Fill in your password then click The Change button. You'll now get an extend list of options on the left hand panel.
[/quote]Thanks wildteen88 :) -
Tell me if I am being blind, but I can't see anywhere in my profile screen where I can update my signature... Any help?
-
Cash, cheque, BACS? Get a merchant account with a bank to accept payment over the phone, or online?
-
Moved to Third Party Scripts forum.
-
I would always [i]rather[/i] type in the shortest. Less effort!
-
[!--quoteo(post=388343:date=Jun 27 2006, 04:48 AM:name=dan182skater)--][div class=\'quotetop\']QUOTE(dan182skater @ Jun 27 2006, 04:48 AM) [snapback]388343[/snapback][/div][div class=\'quotemain\'][!--quotec--]
thanks for the reply, but that made no sense to me.
[/quote]
I meant you could write a script with the PHP functions I listed to search your files. Something like this...
[code]<?php
foreach(glob("dir/to/files/*.php") as $f) {
$lines = file($f);
foreach($lines as $l) {
if(strpos($l,"I am looking for this in my code") !== FALSE) echo "<p>WE HAVE A MATCH IN $f</p>";
}
}
?>[/code]
This is untested, so I'm not sure if it would work. Failingthis, doesn't Windows "find" search within files? -
Look at the properties of an image on both addresses, the second one is different to the first - There is a directory named 'index.php' half way in the location of the file...
Also, please only post PHP questions in the PHP Help forum. Moved. -
the function [a href=\"http://www.php.net/glob\" target=\"_blank\"]glob()[/a] returnsan array of all of the files/directories within a specified directory.
-
There is some good example code in [a href=\"http://uk.php.net/manual/en/function.xml-parse-into-struct.php\" target=\"_blank\"]the manual pages for xml_parse_into_struct()[/a]
-
[code]if (is_resource($rsData)) {
echo "<meta http-equiv='refresh' content='0;url=password2.php'>";
} else {
echo "<meta http-equiv='refresh' content='0;url=incorrect.html'>";
}[/code]
[b]EDIT:[/b] Beaten to it! -
You don't have more than one array there, you have a single array. But to get the result you require, you could probably go about it like so...
[code]<?php
$array = array("2 A1 B1 C1 X","2 A2 B2 C3 Y","2 A3 B3 C3 Z",
"3 D1 E1 F1 A","3 D2 E2 F2 B","3 D3 E3 F3 C",
"4 G1 H1 I1 J","4 G2 H2 I2 K","4 G3 H3 I3 L");
$i = 0;
$new = array();
$tmp = "";
foreach($array as $a) {
$tmp .= "$a\t";
$i++;
if($i%3==0) {
$new[] = $tmp;
$tmp = "";
}
}
echo "<pre>"; print_r($new); echo "</pre>";
?>[/code]
Might need a little tweaking, but it's along the right path. -
You could FTP them across with [a href=\"http://uk.php.net/ftp\" target=\"_blank\"]PHPs FTP functions[/a]. Maybe loop through the directories using glob() ?
require() with variables
in PHP Coding Help
Posted