大家好,大家早上好。这是我关于这个主题的第二篇文章,因为第一次,事情仍然没有奏效,我现在已经连续 4/5 天试图解决这个问题......
我有一个名为“edit.php”的文件,在这个文件中是一个表格;
<?php
$company = $_POST["company"];
$phone = $_POST["phone"];
$colour = $_POST["colour"];
$email = $_POST["email"];
$website = $_POST["website"];
$video = $_POST["video"];
$image = $_POST["image"];
$extension = $_POST["extension"];
?>
<form method="post" action="generate.php"><br>
<input type="text" name="company" placeholder="Company Name" /><br>
<input type="text" name="slogan" placeholder="Slogan" /><br>
<input class="color {required:false}" name="colour" placeholder="Company Colour"><br>
<input type="text" name="phone" placeholder="Phone Number" /><br>
<input type="text" name="email" placeholder="Email Address" /><br>
<input type="text" name="website" placeholder="Full Website - Include http://" /><br>
<input type="text" name="video" placeholder="Video URL" /><br>
<input type="submit" value="Generate QuickLinks" style="background:url(images/submit.png) repeat-x; color:#FFF"/>
</form>
然后,当提交表单时,它会使用已输入的变量创建一个文件。已经填写的字段继续成为链接,我需要能够说'如果一个字段留空,则将'XXX'作为默认值'。有没有人有任何想法?我真的认为我已经尝试了一切。我将在生成链接的 .php 文件中放置一个片段...
<?php
$File = "includes/details.php";
$Handle = fopen($File, 'w');
?>
<?php
$File = "includes/details.php";
$Handle = fopen($File, 'w');
$Data = "<div id='logo'>
<img width='270px' src='images/logo.png'/img>
<h1 style='color:#$_POST[colour]'>$_POST[company]</h1>
<h2>$_POST[slogan]</h2>
</div>
<ul>
<li><a class='full-width button' href='tel:$_POST[phone]'>Phone Us</a></li>
<li><a class='full-width button' href='mailto:$_POST[email]'>Email Us</a></li>
<li><a class='full-width button' href='$_POST[website]'>View Full Website</a></li>
<li><a class='full-width button' href='$_POST[video]'>Watch Us</a></li>
</ul>
\n";
我真的很期待任何回应...