farhan386

are you trying to include [url]http://blahblah[/url] ?
you must have allow_url_fopen enabled to do that

farhan386

What's the point of not saving into PHP and using HTML instead? This will slow down your system a little bit since a pure HTML code should be parsed by PHP.

I'd rather disguise my PHP file as HTML using .htaccess . Visitor will never know what's under the hood after all.

[code]
RewriteRule ^(.*).html$ /$1.php [L]
[/code]

that way you can use
[url]http://mysite.com/foo.html[/url]
to call
[url]http://mysite.com/foo.php[/url]

farhan386

[QUOTE=;][/QUOTE]
You must use two instances of LoadVars.

[code]
boton.onRelease = function() {
var correo = new LoadVars();
//here
var example = new LoadVars();

correo.nom = nombre.text;
correo.ocu = ocupacion.text;
correo.conoc = nos_conoce.text;
correo.ema = email.text;

//here
correo.sendAndLoad("correo.php",example,"POST");
//and here
example.onLoad = function(success:Boolean) {
resultado.text = correo.res;
nombre.text = "";
ocupacion.text = "";
nos_conoce.text = "";
email.text = "";
};
};
[/code]

farhan386

what's the problem?

farhan386

[QUOTE=;][/QUOTE]
just use ordinary link tag
[code]
echo "<a href='".$row['Title']."'>".$row['Title']."";
[/code]

farhan386

Thanks d5e5, it works like a charm

farhan386 Light Poster

I have a string contains sequences of 0 and 1. I need to replace all zero sequences whose length less than 5, into number 1 with same length. The zero sequences with length 5 or more should be left as is.

For example

source : 11000001100010011000001
result : 11000001111111111000001

[CODE]
<?php
$string = '11111000011100000110010';
$pattern = '/0{1,4}/i';
$replacement = '1'; // what should I put here?
echo preg_replace($pattern, $replacement, $string);
?>
[/CODE]

Thanks

farhan386

[code]
$numrows = mysql_num_rows($sql);
if($numrows==0)
{
die ("You currently do not have any friends on photoshare");
}
[/code]

farhan386

farhan386

[quote]
$sTargetPath = 'c:/wamp/www/uploading/uploads/'
[/quote]
it is better and more convenient to use relative path instead of absolute path.
[code]
$sTargetPath = 'uploading/uploads/'
[/code]
Windows use \ as separator, if you insist to use absolute path. Don't forget to add another one as escape character.
[code]
'c:\wamp\www\uploading\uploads\'
[/code]

farhan386

Never encounter something like that. Have you try another browser? Or use a PHP package such as XAMPP

this is my working php.ini
[code]
session.save_handler = files
session.save_path = "D:\xampp\tmp"
session.use_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 100
session.gc_maxlifetime = 1440
session.bug_compat_42 = 1
session.bug_compat_warn = 1
session.referer_check =
session.entropy_length = 0
session.entropy_file =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 4
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="
[/code]

farhan386

[QUOTE=;][/QUOTE]
Basically, you should check if certain session variable exist when the page is being accessed. If that session variable does not exist, then spit a message or take him to login page as vibhadevit said above.

[code]
if( !isset($_SESSION['admin_login']) )
{
echo("Please login first");
}
[/code]

farhan386

[QUOTE=;][/QUOTE]
[quote]
I put print statements in update.php to see if it was receiving the seq_id from news.php and it is not.
[/quote]
most likely this is the "register global" problem. You should edit your code as Almostbob recommend, using $_POST[] etc.

farhan386

seems that you'll have to fetch each column and sum it one-by-one manually. You'll have greater control about these rounding problem, but it will surely slow down your program by a little bit.

farhan386

<a href='blah.php?textboxname='+formname.textboxname.value>

just read using $_GET['textboxname']

alternatively, use an ordinary FORM, and submit it using javascript.

onclick = "document.forms[0].submit()"

farhan386

I found out that mail() function did not work on some web hosting provider. I don't know why, but I experienced it couple of years ago.

I use PHPMailer class till now. It rocks.

farhan386

Are you sure that model numbers are ALWAYS contain at least a number? Or the brand NEVER contain a number? I think you can't just assume that all product will meet this criteria. For instance, "O2 X2i".
It will be even harder since the position of product number is arbitrary.

I think this is human's job

farhan386

The code is incomplete, we don't know what is that "Page" object, it's not defined in your code.

There's a tutorial about file uploading in PHP Manual, it's simple and easy to understand.
[url]http://www.php.net/manual/en/features.file-upload.post-method.php[/url]

farhan386

You might want to try SQLite, a serverless, fast, file-based database. It's ideal to replace a large INI file.

farhan386

3 of 3, I'm not dumb :)

but to be honest, I answer the 1st question randomly. English is not my primary language (it's my 3rd) and I don't know what "syllabus" (or whatever) mean

farhan386

% mean "from any host"

user1@localhost mean "user1 who came from localhost only"
user1@% mean "user1 who came from anywhere"

disabling remote mysql is the safest option, since you can sure that only script resides on your own server are allowed to access your database.

By enabling remote mysql with wildcard (the %), your database can be accessed (and of course, brute forced) from anywhere.

farhan386

If it for private use, cut the file into two pieces and burn them into two DVDs. When you need the file, copy both parts into your hard drive, re-join them, and mount it using virtual drive.

farhan386

Do you use shared web hosting?
Most shared hosting limit mysql connection from localhost only due to security reason. You cant connect to mysql on a shared hosting from different host.

Ask your hosting provider whether they provide "Remote MySQL", or move all of your website to one single server.

farhan386

Try PHPMailer to send such complex email. Better header manipulation, CC/BCC, attachment, SMTP, and much more.

[url]http://sourceforge.net/projects/phpmailer/[/url]

farhan386

It's true that short tag has less character to type. But there are many well PHP editor out there, which automatically create a proper <?php ?> syntax with a single click or via hotkey.

farhan386

try something like this
[code]
$i = 1;
while(.....){
echo $i; echo $yourdata;
$i++;
}
[/code]

farhan386

you should put the public and private files into separated directory.
Create a script using directory functions available in PHP such as scandir() to list the directory content. You may protect this file using session so that only logged user may access it.

farhan386

You may want to user javascript library such jQuery. jQuery is able to make ajax call, or many more javascript stuff for all major browser with a single code. Write less, do more :)

farhan386

That's a Regular Expression (or RegEx in short). Every symbol has a meaning, \ for escaping a non-alphanumeric character, / mark the start of an expression, $ mean end of line, etc etc.

([A-Za-z0-9_-.])+
means I want alphanumeric character, or dash, or underscore, or dot, at least once.

\@([A-Za-z0-9_-.])+
means I want an @ sign followed by alphanumeric character, or dash, or underscore, or dot, at least once

.([A-Za-z]{2,4})
means I want a dot sign, followed by alphabet for at least two and at most four characters.

You may want to take a short tutorial about it, regex will help you a lot in programming, not only for validating email.

farhan386

I don't think you can do that with JS. For security reason, JS should not be able to deeply touch inside client's PC. A website shouldn't be able to force your PC to print all your doc, or shutdown your PC.

You may try to use server side script such as PHP. PHP is able to communicate with COM and working with Word documents.