好的,这是我的第一个帖子,我在网上搜索但没有运气.我正在做实习,我正在开展一个项目,要求我创建一个网页,当用户提交他/她的信息时生成一个pdf文件.一旦客户点击提交按钮,就需要做三件事:
我的意思是,客户确实收到了一封电子邮件,但是当他/她打开pdf文件时,我收到以下错误消息:
"Acrobat无法使用'file_name',因为它不是受支持的文件类型,或者因为文件已损坏(例如,它是作为电子邮件附件发送的,并且未正确解码)......"
请记住,这是我创建pdf文件附件项目的时间.如果有人可以帮我解决这个问题,那就太好了.谢谢!
这是我的代码:
<?php
// once there are no errors, as soon as the customer hits the submit button, it needs to send an email to the staff with the customer information
$msg = "Name: " .$_POST['name'] . "\n"
."Email: " .$_POST['email'] . "\n"
."Phone: " .$_POST['telephone'] . "\n"
."Number Of Guests: " .$_POST['numberOfGuests'] . "\n"
."Date Of Reunion: " .$_POST['date'];
$staffEmail = "staffinfo";
mail($staffEmail, "You have a new customer", $msg); // using the mail …Run Code Online (Sandbox Code Playgroud) 我一直在网上搜索这个,但我似乎找不到足够清楚的东西让我理解.我在Java中看到过类似的"类似"问题.
class animal{
private $name;
// traditional setters and getters
public function setName($name){
$this->name = $name;
}
public function getName(){
return $this->name;
}
// animal constructors
function __construct(){
// some code here
}
// vs
function __construct($name){
$this->name = $name;
echo $this->name;
}
}
$dog = new animal();
$dog->setName("spot");
echo $dog->getName();
// vs
$dog = new animal("spot");
Run Code Online (Sandbox Code Playgroud)
请注意......这是我第一次使用OOP进行Web开发和PHP,并且我试图通过编写一些代码让我的手"脏"来学习,以便我理解OOP中的某些事情.请保持简单.
好的,我开始非常善于使用PHP,但我真的想学习更多知识并扩展我的知识.就在今天,我正在考虑从其他网站获取数据并使用他们的内容将他们的一些内容显示在我稍后将构建的任何网站中.我一直在网上看,我遇到了几个非常有趣的网站,但有不同的解决方案.我的问题是:
谢谢!