这段代码用PHP基准格式写应该是怎样的
这段代码用PHP标准格式写应该是怎样的
在公用PHP文件里做了个判断,需要混排PHP和HTML,自己不会写,麻烦大家帮忙改写一下这段,用PHP的标准写法是怎样的:
- PHP code
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> <?php if $id=1 { echo "<title> $row['p_name']; - 欢迎光临! <meta name="keywords" content="$row['p_name'];,关键字测试"> <meta name="description" content="$row['p_name'];,描述测试"> "; } else { echo "<title>Welcome</title> <meta name="keywords" content="关键字测试"> <meta name="description" content="描述测试"> "; } ?>
谢谢!!!
------解决方案--------------------
还是这样吧:
- PHP code
<?php if( $id === 1 ) { echo "html <title> {$row['p_name']} - 欢迎光临! <meta name='\"keywords\"' content="\"{$row['p_name']},关键字测试\""> <meta name='\"description\"' content="\"{$row['p_name']},描述测试\""> "; } else { echo " <title>Welcome</title> <meta name='\"keywords\"' content='\"关键字测试\"'> <meta name='\"description\"' content='\"描述测试\"'>"; } ?> <br><font color="#e78608">------解决方案--------------------</font><br><?php <br />$title = ''; $keywords = ''; $description = '';<br>if($id==1){<br> $title = $row['p_name'];<br> $keywords = $row['p_name'];<br> $description = $row['p_name'];<br>}?><br><title><?php echo $title;?></title><br><meta name="keywords" content="<?php echo $keywords;?>,关键字测试"><br><meta name="description" content="<?php echo $description;?>,关键字测试"> <br><font color="#e78608">------解决方案--------------------</font><br>- - 傻了,上面第一行应该是$title = 'Welcome' <div class="clear"> </div>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Title is the meaning that defines the title of the web page. It is located within the tag and is the text displayed in the title bar of the browser. Title is very important for the search engine optimization and user experience of the web page. When writing HTML web pages, you should pay attention to using relevant keywords and attractive descriptions to define the title element to attract more users to click and browse.

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code

The title in HTML displays the title tag of the web page, which allows the viewer to know what the current page is about, so each web page should have a separate title.

What is the use of name in Vue3? 1. Name needs to be defined when making recursive components. 2. The component can be cached with keep-aliveincludeexclude. 3. When Vue reports an error or is debugging, you can see the name of the component. Vue3 defines name1. It is automatically generated as long as the setup syntax sugar mode single file component is turned on in the script. The corresponding name option will be automatically generated based on the file name. For example, Tree.vue, then its name will be automatically generated by Tree. This has a drawback. If you want to modify the name, you need to modify the component name. If there is a place to import the component, you need to modify it together. 2. Open a script to define name

Detailed explanation of CSS content attributes: content, counter and quotesCSS (cascading style sheets) is an integral part of front-end development. It can help us beautify web pages and enhance user experience. In CSS, there are some special properties that can be used to control the display of text content, including content, counter, and quotes. This article explains these properties in detail and provides specific code examples. 1. content attribute content attribute

PHP cannot get the name because when the name and id values of the form element are different, the browser cannot recognize it. The solution: 1. Check whether some form elements and frame elements use name; 2. Check only Elements that can be assigned ID but not name; 3. For multi-select box checkbox, you can use "join(',', $__POST['name'])" to form data.

In an interview with CNBC's Andrew Ross Sorkin, Microsoft AI CEO Mustafa Suleymanexpressed his understanding of web copyright law. Suleyman says that content that is accessible on the open web is "freeware," and anyone can copy it, reproduc

不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没问题。
