1
Good folks, I don’t know where to put the question..
I’m sorry if I’m in the wrong area!
Well, I’m racking my brain with a code on my page. The code works it sends the data to my database, only it is not sending a piece of the field for having this Character " # " there is only sending half.
Look at:
The result is coming only the end of the nick code doesn’t arrive=Test"#6287"
Look at the result in the database:
File Code process.php
<?php
$conexao = mysqli_connect("phpmyadmin", "user", "pass");
mysqli_select_db($conexao, "db");
$novoemail = addslashes($_GET["novoemail"]);
$nick = addslashes($_GET["nick"]);
$inserir = "INSERT INTO ajuda (id, email, usuario) VALUES (NULL, '$novoemail', '$nick');";
mysqli_query($conexao, $inserir) or die (mysqli_error($conexao));
echo"";
?>
But then I would have to create another variable to get the number? Because I already have a variable that takes the name#number together..
– LeoS
yes, anchors are not sent from the browser to the server.
– Gabriel Gonçalves
you are picking up by input this information?
– Gabriel Gonçalves
Yes I am. <span class="Lien-blanc-gras">Test#6287</span>
– LeoS
var nick = Document.getElementsByClassName("Lien-blanc-gras")[0]. textContent;
– LeoS
makes 2 <span>, one for nick and one for number
– Gabriel Gonçalves
The page is not mine where I’m pulling the data so there’s no way I can do it.
– LeoS
then the way is to manipulate the text you want by changing the value of the string to upload and then changing the value again: --JS-var example = "Test#1234"; var result = example.replace("#", "."); Alert(result); --PHP-$nick = addslashes($_GET['nick']); $nickCorrigited = str_replace('.', '#', $nick); echo $nickCorrigited;
– Gabriel Gonçalves
Got a friend thanks!!
– LeoS