Add css style to php echo - styles

I am trying to add css style to this echo.
// Execute the query
if($stmt->execute()){
echo "Record was updated.";
I have tried
// Execute the query
if($stmt->execute()){
echo "<p style=\"font-color: red;\">Record was updated</p>";
and although there was no errors, the styling was not applied. How might I succeed in this please.

use
echo '<p style="color: red;">Record was updated</p>';
instead of
echo "<p style=\"font-color: red;\">Record was updated</p>";

Try this
if($stmt->execute()){
echo "<p style="color: red;">Record was updated</p>";
As for me i think that The main problem occur because in css if your want to change the color of text/font then we use color:some color; and you font-color:some color; which is wrong, and the other thing is you use \ in your code and I never seen the \ use with css in php, hope this description is enough for you to understand the issue...
If the answer solved your problem the Mark/consider it as your answer, if the answer is helpful for you then vote it as helpful...

You Can also do it like this
if($stmt->execute())
{
echo '<font color=red>Record was updated</font>';
}

Related

node.js how to put a enter

i am trying to code something in node.js but i don't know how to put a space for my log script:
Hook.info("Logger",`app: ${appopen}`)
what i want it to look like:
app: netflix
other app open: notepad
but i don't know how to put an enter so it looks like that.
so hopefully someone can help me with this!
also more information: im using https://jb3.github.io/webhook-discord/
Julien's answer should be correct. I can't yet comment but be sure that you're using backticks since those are what you need for template literals. It shouldn't be
Hook.info("Logger", "test \n ${appopen}"
but rather
Hook.info("Logger", `test \n ${appopen}`)
If you meant you wanted a carriage return at the end of the line then it should be
Hook.info("Logger", `test ${appopen}\n`)
You mean a Carriage Return, I guess. Try Hook.info("Logger", "\n")

github svg not rendering at all

I am trying to create a markdown file in github and would like to put a svg image in it. github is not rendering the image at all. I tried with <img />, with ![](). Is simply not working! Anyone has seen this?
Just modified the repository so that is public: https://github.com/michelucci/deepbook
Thanks in advance, Umberto
It seems like GitHub now requires the http query parameters sanitize=true at the end of the SVG string. If you're linking to an image in your repository from a wiki, you may already have parameters at the end of the URL. So either add ?sanitize=true if there are no query parameters, or &sanitize=true otherwise
<img alt="my image" src="https://raw.githubusercontent.com/user/branch/images/myimage.svg?example=foo&sanitize=true>
GitHub's markdown seems to be blocking SVG files, but you can always use bare HTML tags:
<img src="neuron_fig1.svg"/>
Update 2022: a simple drag & drop is enough.
Original answer (2017)
See issue 458 regarding any inline HTML, but since it is not your issue, you can compare your page to this one: it does display a lot of svg pictures, and its source is here.
"source": [
"## Python Objects\n",
"\n",
"We begin with a look at a Python object. In Python, objects are stored in memory blocks independently allocated on the heap. A single floating point value looks something like this:\n",
"\n",
"![Python Float](fig/python_float.svg)\n",
"\n",
"This doesn’t look too bad, in a dynamically typed system we need to store some metadata about the type, and we need to store the data containing the value."
]
},
So relative URL (to docs/intro-01/fig) does work.
Your code:
"source": [
" ![](neuron_fig1.svg) \n",
" **Fig. 1** The structure of a neuron. $x_i$ are the input, $w_i$ are the weights."
]

Disable syntasic html/tidy checker for a file

Is there a way to disable the html/tidy plugin for syntastic for a certain file?
I have a handlebars template that contain an empty <tbody></tbody> tag as a placeholder, and I keep getting the error
trimming empty <tbody> [html/tidy]
Is there a way to either disable this specific rule, or just disable the html/tidy plugin for this specific file?
Try to put this in your .vimrc
let g:syntastic_html_tidy_ignore_errors=[" proprietary attribute " ,"trimming empty <", "unescaped &" , "lacks \"action", "is not recognized!", "discarding unexpected"]
This solves more things than one but I think it can be helpful. More on this here.
I was running into this with .hbs and .html templating for a node project. Adding this to my .vimrc helped:
let syntastic_mode_map = { 'passive_filetypes': ['html'] }
more options here https://github.com/scrooloose/syntastic/issues/240
Additionally, if you just want to turn warnings off for html tidy:
let g:syntastic_html_tidy_quiet_messages = { "level" : "warnings" }
I have found this is a welcome setting for editing twig templates.
Of course for more info, in vim:
:h syntastic-checkers

Groovy string replace add new line

Got a groovy script that is pulling some text from a soap connection and I am trying to add a bullet point before any bullet points. Here is the code I have but it does not work and it may never work, but thought I would ask.
td (it.#detail.toString().replaceAll('>', '>').replaceAll("•", "\n •"))
That should work.
ie, try:
println it.#detail.toString().replaceAll('>', '>').replaceAll("•", "\n •")
To see it working in the console output.
I guess you're viewing this in HTML with a browser?
Newlines don't appear in HTML normally, so you'd need to wrap the text in a <pre> tag.
Assuming this is with StreamingMarkupBuilder or similar, try:
td {
pre( it.#detail.toString().replaceAll('>', '>').replaceAll("•", "\n •") )
}

Is there an Open-Source Web Search Library that does not use a Search Index File?

I'm looking for an open-source web search library that does not use a search index file.
Do you know any?
Thanks,
Kenneth
You mean:
search.cgi
#/bin/sh
arg=`echo $QUERY | sed -e 's/^s=//' -e 's/&.*$//'`
cd /var/www/httpd
find . -type f | xargs egrep -l "$arg" | awk 'BEGIN {
print "Content-type: text/html";
print "";
print "<HTML><HEAD><TITLE>Search Result</TITLE></HEAD>";
print "<BODY><P>Here are your search results, sorry it took so long.</P>";
print "<UL>";
}
{ print "<LI>" $1 "</LI>"; }
END {
print "</UL></BODY>";
}'
Untested...
The original poster clarified in a comment to this reply that what he is looking for is essentially "greplike search but through HTTP", and mentioned that he is looking for something that uses little disk as he's working with an embedded system.
I am not aware of any related projects, but you might want to look at html parsers and xquery implementations in your language of choice. You should be able to take care of "real-life" messiness of html with the former, and write a search that's almost as detailed as you might desire with the latter.
I assume that you will be working with a set of urls that will either be provided, or already stored locally, since the idea of actually crawling the whole web, discovering links, etc, in an embedded device is thoroughly unrealistic.
Although with a good html/xquery implementation, you do have the tools to extract all the links..
My original answer, which was really a request for clarification:
Not sure what you mean. How do you picture a search working without an index? Crawling the web for every query? Piping through to google? Or are you referring to a specific kind of search index file that you are trying to avoid?
I guess there is none (at least that is popular enough for users here to be aware of).
We've went ahead to code our own Search system.

Resources