buddylee17 216 Practically a Master Poster

PayPal also provides a Sandbox to test dummy transactions and work all of the bugs out.

buddylee17 216 Practically a Master Poster

So did you get everything to work?

buddylee17 216 Practically a Master Poster

I would need a link to the page to see exactly what's happening, but yes it can be done with javascript.

buddylee17 216 Practically a Master Poster

PHP variables are case sensitive. $Othernames is not the same as $OtherNames and $dateofbirth is not the same as $Dateofbirth . There are also some syntax issues.

So

if mail'('$Surname, $Othernames, $dateofbirth, $age, $sex')'

should be

if(mail($Surname, $OtherNames, $Dateofbirth, $age, $sex))

Also, please surround your code with [code=php]php code here [/code] tags when posting.

buddylee17 216 Practically a Master Poster

I believe you'll need to use the complete host information:

$fp = fsockopen("alertbox.in", 80);

should be

$fp = fsockopen($host, 80);
buddylee17 216 Practically a Master Poster

You need to integrate a server side language such as php/asp/jsp/coldfusion to automatically update the database. You shouldn't be creating a new page for each user. You should have one template filled with variables that are populated by the database.

buddylee17 216 Practically a Master Poster

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 the if statement being true every time. If you want to compare $lengths[2] to 25, use:

if ($lengths[2] == 25) {

The same applies to $lengths[3].

buddylee17 216 Practically a Master Poster

In flash you should have a dynamic text box. It should be assigned a Var name. Let's say the Var name is box. In php, you'll need to assign the output to a variable. I'll assign it to the variable $box. Then just echo it like so:

echo "&box=$box";

If your actionscript is correct, it will display the variables output.

buddylee17 216 Practically a Master Poster

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 in";
}
else{
echo "You are not logged in";
}?>
buddylee17 216 Practically a Master Poster

PayPal provides Instant Payment Notification (IPN).
https://www.paypal.com/cgi-bin/webscr?cmd=p/xcl/rec/ipn-intro-outside&
They have a demo on the site to show how it works.

Once PayPal sends the server a verified status, you can enable the button.

buddylee17 216 Practically a Master Poster

Yes the rewrite rule I left earlier will make the id value appear to be the html file. So if you typed
www.blastingart.com/New Features.html into the url, it would be parsed by the server as www.blastingart.com/viewPage.php?ID=New Features

buddylee17 216 Practically a Master Poster

Yeah, you probably don't want to limit yourself to web development. Either stick with CS or find something that involves security. My school had an Master in Information Systems and E-Commerce degree that was pretty close to what your looking for.

buddylee17 216 Practically a Master Poster

Your javascript is really overkill. You have 3 functions that could be condensed into one. Also, the 3 divs, Des_pic1-3, could be condensed since only one is displayed at a time. All of these things would also help condense the css.

buddylee17 216 Practically a Master Poster

Basically something like

RewriteEngine on 
RewriteRule ([^/\.]+)/?.html$ viewPage.php?ID=$1 [L]

So if you typed
www.blastingart.com/New Features.html
into the url, it would be the same as typing in
www.blastingart.com/viewPage.php?ID=New Features

wickedsunny commented: thanks simmply genius !! +1
buddylee17 216 Practically a Master Poster

Ok, well try this:

$arrivaldate	= mysql_real_escape_string(date("Y-m-d",strtotime($_POST['arrivaldate']));
buddylee17 216 Practically a Master Poster

Try:

<?php
$file=".htaccess";
$fp=fopen($file, "a");
$text ="\r\nRewriteEngine on \r\nRewriteRule ^page/([^/\.]+)/?$ index.php?page=$1 [L]";
fwrite($fp, $text);
fclose($fp);
?>
buddylee17 216 Practically a Master Poster

Yeah, I'd say something like:

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

would work. Try it out and post back.

buddylee17 216 Practically a Master Poster

PayPal. You only want to sell 3 products right?

buddylee17 216 Practically a Master Poster

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.

buddylee17 216 Practically a Master Poster

Yes here's a showcase of preloader examples. Scroll down and click on the images to see what the preloader looks like. They basically perform two functions.
1. Entertain the user while the movie is downloading
2. Inform the user the progress of the download
Once the download is complete, the flash movie loads and the preloader disappears.

buddylee17 216 Practically a Master Poster

If you want to lower the file size, make it web accessible, and add a preloader, convert the ppt to flash. If your not familiar with Flash, just Google powerpoint to flash.

buddylee17 216 Practically a Master Poster

How is the cart stored? Browser cookies? A session on the server?

buddylee17 216 Practically a Master Poster

You could use str_replace function to replace "//" with "/".

$uploadsDirectory = $_SERVER['DOCUMENT_ROOT'] . $directory_self . 'uploaded_files/'; 
$uploadsDirectory = str_replace("//","/",$uploadsDirectory);

There are many other ways of fixing the problem. str_replace just seems the easiest to me.

buddylee17 216 Practically a Master Poster

Your probably not previewing the file via through the server. What testing server are you using? Make sure your url is something like with http://localhost/filename.php. Where filename.php is your file. Also make sure the file is saved in your htdocs folder.

buddylee17 216 Practically a Master Poster

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', '$message')");

This could also apply to the index, however since you are inserting an empty value, I would assume the datatype is not numeric.

buddylee17 216 Practically a Master Poster

Try this one out:

<?php
$group =array("A","a","B","b");
$row = "You are the best At BaseBall";
$all = implode("|",$group); // convert the array into a pipe delimited string
echo (ereg_replace($all,"<b>\\0</b>",$row));
?>
buddylee17 216 Practically a Master Poster

You could start off with basic data validation. Pumping all of the fields into the db without checking even one of them? That's just asking for injection.

buddylee17 216 Practically a Master Poster

What about something like:

<?php
function makeBold($var){
   return (ereg_replace("[a|b]+[a-z]+[a-z]","<b>\\0</b>",$var));
}
$row = "You are the best";
echo makeBold($row);
?>

Outputs: You <b>are</b> the <b>best</b>

buddylee17 216 Practically a Master Poster

Look into php/mysql basics. That's Facebook's platform. I'd suggest downloading Wamp or XAMPP, set up a db with phpmyadmin, and learn how to pull content from the db and place it in the page. There are literally tons of php tutorials on the web to help in learning the basics. Also, our php forum is one of the best on the web so if you get stuck, you've got more tech support than Micro$oft could ever offer.

buddylee17 216 Practically a Master Poster

Are you asking how to make a social networking site?

buddylee17 216 Practically a Master Poster

Also, if you have phpmyadmin, you can just upload the csv instead of writing a script.

buddylee17 216 Practically a Master Poster

Can you not set the field to auto-increment in the database?

buddylee17 216 Practically a Master Poster

Wow that's crazy. It shouldn't matter what order you assign the values. huh

buddylee17 216 Practically a Master Poster

if($uid=$_GET['u'] && $pid=$_GET['p'] && $t=$_GET['ti'] && $type=$_GET['typ']) You are setting values instead of comparing them. To compare, use if($uid==$_GET['u'] && $pid==$_GET['p'] && $t==$_GET['ti'] && $type==$_GET['typ'])

buddylee17 216 Practically a Master Poster

Yeah, you don't want to prevent a page refresh. That takes quite a bit of JavaScript and quite frankly would annoy users. They don't want you to change their browsers behavior. Fix your code logic. Don't mess with browser hacks.

buddylee17 216 Practically a Master Poster

Post in the appropriate forum. This is not a php issue. If it were, the calendar wouldn't work on any browser.

buddylee17 216 Practically a Master Poster
<?php
$oldDate="2007-06-26";
$newDate=date("m-d-Y",strtotime($oldDate));
echo $newDate;
?>

outputs: 06-26-2007
For more info, see the php date manual:
http://us3.php.net/date

buddylee17 216 Practically a Master Poster
buddylee17 216 Practically a Master Poster

The border-radius attribute isn't yet supported by many browsers, like IE. I would recommend using FireWorks or Photoshop to make your buttons, since border-radius is only supported by Firefox, Safari, and a few others.

buddylee17 216 Practically a Master Poster

Set $theHash equal to empy before the for loop.
Also, I think you'll want to poulate $theHash like this:

$theHash="";
for($i=0;$i<strlen($theMD5);$i++)
{
	$tmp1 = ord($theMD5[$i]) / 16;
	$tmp2 = ord($theMD5[$i]) % 16;

	$theHash.= $hexArr[$tmp1] . $hexArr[$tmp2];
}
buddylee17 216 Practically a Master Poster

Sure, what I was mainly trying to say was that AJAX should only be used to enhance the users experience.

A page submit or refresh can sometimes be inconvenient and time consuming. With AJAX, the user can click the search button, continue looking at the page, and seconds later the results are there.

Just don't abuse AJAX, because most of the data transmitted in an AJAX request is overhead (headers-usually 300-500 bytes depending on the browser). So even though the data request is only 5 bytes, you still send 300 to 500 bytes of data. So one page refresh can be faster than multiple AJAX requests. Also, if the page has to be reloaded anyway, AJAX is unnecessary.

buddylee17 216 Practically a Master Poster

Why do you need AJAX for this?

Once the next page has loaded, display that variable using GET

AJAX is typically used to perform functions without a page load. If the page is going to load anyway, it would be much simpler just to use a server side script.

I'd like the user to be able to enter text and click search using POST method
Once the next page has loaded, display that variable using GET

I don't believe that javascript can directly access the POST array. The server has to read the post array and then output it to the page before javascript can access it. Javascript can access the GET array however, through the url.

buddylee17 216 Practically a Master Poster

No, you'll have to show some kind of effort first. The site is called daniweb. Not free code for the lazy.

buddylee17 216 Practically a Master Poster

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.

buddylee17 216 Practically a Master Poster

For starters, <php is not a valid delimiter. Use <?php to start the code and ?> to end it. Is Apache and php configured correctly? Have you tried a simple <?php echo "It works.";?> type script to test the server?

buddylee17 216 Practically a Master Poster

Please wrap your code in code tags:

[code=html] Put code here [/code]

buddylee17 216 Practically a Master Poster

you mean delete all the html headers and stuff? and change the extension from header.php to header.cgi?

No don't change the .php extension. Here's how I would do it:

<?php
$name= $_POST['name'];
$from = $_POST["email"];
$to = "blah@blah.com";
$subject = "Proposal Request";
$message = "Company Name: " . $_POST["companyname"] . "\n";
$message .= "Telephone Number:" . $_POST["telephonenumber"] . "\n";
$message .= "Email Address:" . $_POST["email"] . "\n";
$message .= "Company Name:" . $_POST["companyname"] . "\n";
$message .= "Company Address:" . $_POST["location"] . "\n";
$message .= "City:" . $_POST["city"] . "\n";
$message .= "State:" . $_POST["state"] . "\n";

//Checkboxes
//Service Needed
$service = $_POST['service'];
 if(is_array($service))
{
    $message .= "Type of Service needed:" .implode(", ",$service). "\n";
}

//Best Time to Contact
$time = $_POST['time'];
 if(is_array($time))
{
    $message .= "Best Time to Contact:"  .implode(", ",$time). "\n";
}
//Contact Preference
$cpref = $_POST['cpref'];
 if(is_array($cpref))
{
    $message .= "Contact by Email/Phone:"  .implode(", ",$cpref). "\n";
}
if($sent){
	$headers = 'From: ' . $name . ' <' . $from . '>' . "\r\n" .
		'Reply-To: ' . $from . "\r\n" .
		'X-Mailer: PHP/' . phpversion();
	
	mail($to, $subject, $message, $headers);
	header("location:thankyou.php"); 
        exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
<!--
.style2 {font-size: 14px; }
-->
</style>

</head>

<body>


<?php
include("../header.php"); //This includes the layout 
?>

Notice how most of the server side processing is done before the doctype. Also, the header is sent prior to any html output.

buddylee17 216 Practically a Master Poster

Yes, delete everything before the <? delimiter and use the script as a cgi. Since you are doing a redirect, you don't need to send any content to the browser. Just the header.

buddylee17 216 Practically a Master Poster

Yes, you can't echo or print anything prior to using header. Headers can only be sent once. If you have any output to the browser, headers are sent. Then when you try to send more headers, you get errors.

buddylee17 216 Practically a Master Poster

Remove echo "The Email Has Been Sent"; . The header has to be the first thing sent to the browser.