Search Results

Showing results 1 to 40 of 96
Search took 0.01 seconds.
Search: Posts Made By: buddylee17 ; Forum: PHP and child forums
Forum: PHP Sep 3rd, 2009
Replies: 4
Views: 291
Posted By buddylee17
http://www.sitepoint.com/article/guide-url-rewriting/
Forum: PHP Apr 30th, 2009
Replies: 6
Views: 1,513
Posted By buddylee17
You'll have to use your isp's SMTP server.
See here:http://roshanbh.com.np/2007/12/sending-e-mail-from-localhost-in-php-in-windows-environment.html
Forum: PHP Mar 29th, 2009
Replies: 8
Views: 1,417
Posted By buddylee17
Echo the variable into the xml.

<?php $imagea= 'http://localhost/personal_trainer_system/images/Bench.jpg'?>;

myImage['blue'] = new Image();
myImage['blue'].src = <?php echo $imagea; ?>;
Forum: PHP Mar 29th, 2009
Replies: 8
Views: 1,417
Posted By buddylee17
You'll either have to give the xml file a .php extension, or set Apache to parse php in xml files. This can be done with the http.conf file or with a .htaccess file. If you don't have access to the...
Forum: PHP Mar 13th, 2009
Replies: 2
Views: 535
Posted By buddylee17
Use substr function. Note, I also used strpos in the example to ensure that the last word isn't broken up.

<?php
$str="The quick lazy fox jumps over a lazy dog.";
$space=" ";...
Forum: PHP Mar 3rd, 2009
Replies: 2
Views: 1,469
Posted By buddylee17
Sometimes it's easier to tell php which html to send to the client, based on a condition. Simple example:

<?php
$show="invalid";
if($show=="valid"){
?>
<div>You get to see this content</div>...
Forum: PHP Mar 1st, 2009
Replies: 5
Views: 788
Posted By buddylee17
Read this:
http://www.seocompany.ca/software/free-encryption-software.html
Forum: PHP Feb 27th, 2009
Replies: 5
Views: 2,340
Posted By buddylee17
Yes, the same for more fields. Basically, if you add a text field into the form, you'll need to update the javascript variable, postr on line 52 above so that it will send the value to the php file. ...
Forum: PHP Feb 26th, 2009
Replies: 26
Views: 2,061
Posted By buddylee17
Actually, I modified your query to test the code in my db prior to posting and it outputted "No rows retrieved'". Also, when I run the code like so:

$sql = 'SELECT * FROM `absent faculty table`...
Forum: PHP Feb 26th, 2009
Replies: 18
Views: 3,392
Posted By buddylee17
Rewrite rules don't actually hide the query string. Rewrite rules pretty much convert seo friendly urls into the actual query string.
Example .htaccess:

RewriteEngine on
RewriteRule...
Forum: PHP Feb 26th, 2009
Replies: 26
Views: 2,061
Posted By buddylee17
You have to get the number of rows.

$a = "SELECT * FROM a WHERE b = c";
$b = mysql_query($a);
$num_rows = mysql_num_rows($b);
if($num_rows == 0) {
echo "No rows retrieved";
} else {
echo...
Forum: PHP Feb 26th, 2009
Replies: 5
Views: 2,340
Posted By buddylee17
Here is a simple AJAX form submission using POST. It basically sends the first and last name to the server, and the server outputs the form information and the date on the server. Very simple, but...
Forum: PHP Feb 21st, 2009
Replies: 3
Views: 500
Posted By buddylee17
The file is included inline and parsed just like the contents of the file would be if they were placed there instead. A standard include for the content could be something like:
content.php:

<div...
Forum: PHP Jan 27th, 2009
Replies: 4
Views: 562
Posted By buddylee17
Either disable html messages or look into using BBCode
Forum: PHP Jan 26th, 2009
Replies: 4
Views: 562
Posted By buddylee17
Use captcha (http://www.white-hat-web-design.co.uk/articles/php-captcha.php).
Forum: PHP Jan 21st, 2009
Replies: 14
Solved: Mail() question
Views: 631
Posted By buddylee17
You've got to make it a link:

$link = "<a href='".BASE_URL . 'activate.php?x=' . urlencode($e) . "&y=$a'>".BASE_URL."</a>";
Forum: PHP Jan 21st, 2009
Replies: 14
Solved: Mail() question
Views: 631
Posted By buddylee17
What does echo $link; output?
Forum: PHP Jan 21st, 2009
Replies: 4
Views: 612
Posted By buddylee17
So did you get everything to work?
Forum: PHP Jan 19th, 2009
Replies: 4
Views: 612
Posted By buddylee17
Well are you trying to compare the value of $lengths[2] to 25 or set $lengths[2] equal to 25?

if ($lengths[2] = 25) {

This code is resetting the value of $lengths[2] to 25 and will result in...
Forum: PHP Jan 17th, 2009
Replies: 1
Views: 310
Posted By buddylee17
Look into using sessions for authentication. Basically the idea is:

<?php
session_start();
if($_SESSION['loggedIn']==true){
echo "This content will only be viewable for users who are logged...
Forum: PHP Jan 16th, 2009
Replies: 6
Views: 989
Posted By buddylee17
Ok, well try this:

$arrivaldate = mysql_real_escape_string(date("Y-m-d",strtotime($_POST['arrivaldate']));
Forum: PHP Jan 16th, 2009
Replies: 6
Views: 989
Posted By buddylee17
Yeah, I'd say something like:

$arrivaldate = mysql_real_escape_string(strtotime($_POST['arrivaldate']));

would work. Try it out and post back.
Forum: PHP Jan 16th, 2009
Replies: 6
Views: 989
Posted By buddylee17
You'll want to format the date back prior to doing the insert. So, in the script you use to process the form data, use strtotime to convert the string to a timestamp. Then insert the data.
Forum: PHP Jan 12th, 2009
Replies: 3
Views: 494
Posted By buddylee17
You could use str_replace function to replace "//" with "/".

$uploadsDirectory = $_SERVER['DOCUMENT_ROOT'] . $directory_self . 'uploaded_files/';
$uploadsDirectory =...
Forum: PHP Jan 11th, 2009
Replies: 2
Views: 394
Posted By buddylee17
If the user_id data type is numeric, then it won't need single quotes in the sql.

$sql = mysql_query("INSERT INTO shoutbox (index, user_id, username, message) VALUES(' ', $user_id, '$username',...
Forum: PHP Dec 28th, 2008
Replies: 6
Views: 825
Posted By buddylee17
No, you'll have to show some kind of effort first. The site is called daniweb. Not free code for the lazy.
Forum: PHP Dec 28th, 2008
Replies: 6
Views: 825
Posted By buddylee17
Set a field called verified in the database with a default value of 0 or False. Then after admin verifies, have him/her set the value to 1 or True.
Forum: PHP Dec 23rd, 2008
Replies: 6
Views: 820
Posted By buddylee17
Please start a new thread and mark this one as solved.
Forum: PHP Dec 9th, 2008
Replies: 6
Views: 820
Posted By buddylee17
Why are you trying to open an html page with fopen?
Use:
header('Location:http://www.stopaeta.org');
Forum: PHP Dec 9th, 2008
Replies: 6
Views: 820
Posted By buddylee17
Have you tried using a header?
header('Location:index.php');

This will only work if nothing has been outputted to the client yet.
Forum: PHP Dec 5th, 2008
Replies: 17
Views: 1,908
Posted By buddylee17
Create a blank php page and put the following in to see how it should work:

<?php
$profpic="http://www.daniweb.com/alphaimages/logo/logo.gif";
?>
<html>
<head>
<style type="text/css">
body...
Forum: PHP Dec 5th, 2008
Replies: 17
Views: 1,908
Posted By buddylee17
No, throw out that completely overkill switch statement and get rid of any attributes and values in the body. We don't do it like that anymore. We use CSS. Here's the basic idea:

<?php ...
Forum: PHP Dec 5th, 2008
Replies: 17
Views: 1,908
Posted By buddylee17
The code assumes that php has been closed with a ?> delimiter prior to the style tag
Forum: PHP Dec 5th, 2008
Replies: 17
Views: 1,908
Posted By buddylee17
Just do this if you want to assign it to the body:
<style type="text/css">
body{
background-image:url('<?php echo $profpic ;?>');
}
</style>
Note: This should go in the head of the document.
Forum: PHP Dec 1st, 2008
Replies: 10
Solved: please help
Views: 745
Posted By buddylee17
The name the element has in the form goes inside the brackets.
So if your form has

<input name="name" type="text" id="name" tabindex="16" />

After the form is submitted, PHP can assign the...
Forum: PHP Dec 1st, 2008
Replies: 10
Solved: please help
Views: 745
Posted By buddylee17
Wrap the code like so:
Code goes here

As to your problem, your email contains undefined variables. For instance you define namefield as $nameField = $_POST['name']; but in the email you send, you...
Forum: PHP Dec 1st, 2008
Replies: 10
Solved: please help
Views: 745
Posted By buddylee17
Next time, wrap your code in code tags (http://www.daniweb.com/forums/misc.php?do=bbcode#code) when posting to keep things neat. There are plenty of people here to help out. Keeping things neat will...
Forum: PHP Dec 1st, 2008
Replies: 10
Solved: please help
Views: 745
Posted By buddylee17
Glad to help.
Forum: PHP Dec 1st, 2008
Replies: 10
Solved: please help
Views: 745
Posted By buddylee17
When using heredoc, you must open and close the variable with the same identifier. $body = <<<em
<br><hr><br>
name: $name <br>
surname: $surname <br>
email: $email <br>
telephone: $telephone...
Forum: PHP Nov 28th, 2008
Replies: 3
Views: 403
Posted By buddylee17
Just use > instead of GREATER THAN. Since xCount is numeric, you also won't need quotes around it. So I think:
$sql = "SELECT * FROM `textads` WHERE `expos` > xCount ORDER BY RAND() LIMIT 3"; ...
Showing results 1 to 40 of 96

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC