
cdmafra
Members-
Posts
61 -
Joined
-
Last visited
Everything posted by cdmafra
-
Hello. I am trying to upload photos with PHP and MYSQL for my website. How must I to do that? I'm trying, I have the required <input>, but when I publish it returns me: " Notice: Undefined index: news_image in C:\wamp\www\mrn_site\login\main.php on line 75", and the picture don't goes to required directory if (isset($_POST["publish-p"])) { $news_image= mysql_real_escape_string($_POST['news_image']); } { if (($_FILES['news_image'])) { move_uploaded_file($_FILES['news_image']['tmp_name'], "../images".$_FILES['news_image']); }
-
I noted that meanwhile. Many thanks!
-
Hello. I have a strange error T_String, because it was not there until I changed my server. I updated my details, but returns: Parse error: syntax error, unexpected T_STRING in /usr/home/motorra/public_html/login/db_connect_close.php on line 4 1. <?php 2. $link = mysql_connect("localhost", "USER", "PASS") 3. // Close connection 4. mysql_close($link); 5. ?>
-
I usually take a long time to understand somethings in areas as PHP or Matemathics. Meanwhile, I saw one thing wrong in your first code snippet integrated with my existing code, and so in that way this works. The period for concatenation after .$row['copyright'] was wrong... <p id="data"><?php echo $row["news_date"]; ?>, <?php echo$row["hour"] ;?> GMT<br/>Copyright Imagem: <?php if ($row['copyright'] <> Desconhecido) echo "Copyright Imagem: " . $row['copyright'] ; ?></p>
-
I know, otherwise it would be impossible to build a PHP-based website as I did. I am just not understanding you...
-
Thank you. Now returns me the error: "Parse error: syntax error, unexpected T_ECHO in /www/users/m/o/t/motorracingnews/index.php on line 117" <?php $news_date= echo $row['news_date']; $hour= echo $row['hour'] "GMT"; $copyright= if ($row['copyright'] <> Desconhecido) echo "Copyright Imagem: " . $row['copyright'] . ?> <p id="data"><?php $news_date $hour $copyright?></p>
-
So if I understood, I need to define that variables ($news_date, etc.) previously, echoeing the values that I want?
-
I understood... so: <?php "<p id='data'>"echo .$row['news_date'].$row['hour']. " GTM<br/>" if ($row['copyright'] <> null) echo "Copyright Imagem: " . $row['copyright'] .; "</p>"?>
-
I adapted the code snippet to my design, but when I copy-paste exactly it not returns the error, but continues to show "Copyright Imagem", only not shows the $row['copyright']
-
Hello. I want to show in my website all entries from a table, but I only want to show some values in one of the DB columns: Copyright Imagem: <?php echo $row["copyright"]; ?></p> Whati I want is to show all entries for $row["copyright"], except the ones in what the value is "null". The remaining columns, I want to show all of them.
-
Hello. How can I integrate a "gallery maker" with TinyMCE editor, with images from external source (I don't want to upload images to my website server, because I have a limited storage space).
-
Thank you... but it works? I am not inside Ajax and Comet....
- 13 replies
-
- dynamic title
- problem
-
(and 3 more)
Tagged with:
-
Just like in fastsol example? If yes, this is not working for me ... sorry all mess, but I am a beginner in PHP/MySQL.. My base code: <title>Motor Racing News | Informações de Altas Rotações</title> (...) <?php if (isset($_REQUEST["guid"])) { $guid = mysql_real_escape_string($_REQUEST["guid"]); // sanitize the guid $query = "SELECT * FROM news WHERE news_guid='".$guid."'"; $result = mysql_query($query); $row = mysql_fetch_array($result); ?> <div class="twelve columns"> <div class="row"><h3 class="n3"><?php echo $row["news_title"]; ?></h3> </div> </div> <div class="row"><!-- Row interior--> <div class="twelve columns"> <div class="panel"> <p id="data"><?php echo $row["news_date"]; ?>, <?php echo$row["hour"] ;?> GMT</p> <p><?php echo $row["news_post"]; ?></p >
- 13 replies
-
- dynamic title
- problem
-
(and 3 more)
Tagged with:
-
Yes
- 13 replies
-
- dynamic title
- problem
-
(and 3 more)
Tagged with:
-
Don't worked that code , fastsol :/ I have the title and description generated only one time to entire website (articles, pages, etc.) in the Index.php, this way: <title>Motor Racing News | Informações de Altas Rotações</title>
- 13 replies
-
- dynamic title
- problem
-
(and 3 more)
Tagged with:
-
Thank you very much!
-
Thank you. But How can I quote GUID values? <?php { $query = "SELECT * FROM news WHERE destaque='Sim' and publicado='sim' ORDER BY news_id DESC LIMIT 4"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { echo "<div class='three columns'>"; echo "<a href='?guid=".$row["news_guid"]." class='div-link'>"; echo "<div class='desc-new'>"; //imagem echo "<div class='img-block'><img src='".$row['news_image']."' title='".$row["news_title"]."' alt='".$row["news_title"]."'/></div>"; //texto echo "<h4 class='new-title' onmouseover='none'>".$row["news_title"]."</h4>"; echo "<h4 class='new-subtitle' onmouseover='none'>".$row["news_subtitle"]."</h4>"; echo "<aside><p>".$row["news_desc"]."</p><p class='datapeq'>".$row["news_date"].", ".$row["hour"]."</p></aside>"; echo "</div>"; echo "</a>"; echo "</div>"; } } ?>
-
It was what I did, but the browser returns the error: SCREAM: Error suppression ignored for Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\mrn_site\news_principais.php on line 10Call Stack#TimeMemoryFunctionLocation10.0015163408{main}( )..\index.php:021.0202193616include( 'C:\wamp\www\mrn_site\news_principais.php' )..\index.php:195 31.0222190760mysql_fetch_array ( )..\news_principais.php:10 news_principais.php:10: <?php if (isset($_REQUEST["guid"])) { $query = "SELECT * FROM news WHERE news_guid=".$_REQUEST["guid"].""; $result = mysql_query($query); $row = mysql_fetch_array($result); ?> index:195 default: include("news_principais.php"); break; }
-
No, no. I have just one table, and I need to keep ID and create the GUID (at this moment I already have the structure done). Now, I need to update automatically the GUID to all existing table records. And after, put the link working with GUID instead ID (example: www.mysite.com/?id=103 to www.mysite.com/?=guid=1fa16860-7e6f-468d-9450-65a33d6eabaf). But feeding PHP through GUID, there is an error of non-existing variable. As soon as possible I post my code here.
-
Well, I don't explained the situation correctly. I have a GUID field, what I need is to auto generate the GUID for all table entries already existing. And after that, to show GUID instead ID in the URL...
-
Hello. I'm writing this post to ask a question: how to "transform" ID fields to GUID? Is there any solution? If not, how can I create a GUID field/column in my MySQL table?
-
Hello. I'm getting an error in my website when I pubish a new post: I cannot identify the problem, as I don't changed anything before that occured... Additionally, the problem also occurs in MySQL in the same place Publish PHP code: <?php if (isset($_POST["publish-p"])) { $categoria= mysql_real_escape_string($_POST['categoria']); $categoria2= mysql_real_escape_string($_POST['categoria2']); $destaque= mysql_real_escape_string($_POST['destaque']); $publicado= mysql_real_escape_string($_POST['publicado']); $news_title= mysql_real_escape_string($_POST['news_title']); $news_subtitle= mysql_real_escape_string($_POST['news_subtitle']); $news_desc= mysql_real_escape_string($_POST['news_desc']); $news_post= mysql_real_escape_string($_POST['news_post']); $news_date= mysql_real_escape_string($_POST['news_date']); $hour= mysql_real_escape_string($_POST['hour']); $news_image= mysql_real_escape_string($_POST['news_image']); $news_image_peq= mysql_real_escape_string($_POST['news_image_peq']); $publish="INSERT INTO news(categoria,categoria2,destaque,publicado,news_title,news_subtitle,news_desc,news_post,news_date,hour,news_image,news_image_peq) VALUES('$categoria','$categoria2','$destaque','$publicado',$news_title','$news_subtitle','$news_desc','$news_post','$news_date','$hour','$news_image','$news_image_peq')"; mysql_query($publish) OR DIE(mysql_error()); //mensagem após submeter dados echo "<script>alert('Notícia publicada!');</script>"; } ?> <!--CONTEUDO--> <div class="row"> <div class="twelve columns"> <form action="#" method="post" onsubmit="return $(this).validate()" name="publish" > <h3 class="n3">Publicar notícia</h3> <div class="publish-content"> <div> <h3 class="n3v4">Categoria</h3> <select name="categoria"> <option value="Autos/Pistas">Autos/Pistas</option> <option value="Autos/Ralis-TT">Autos/Ralis-TT</option> <option value="Motos/Pistas">Motos/Pistas</option> <option value="Motos/Ralis-TT">Motos/Ralis-TT</option> <option value="Outros">Outros</option> <option value="Entrevistas">Entrevistas</option> </select> </div> <br/> <div> <h3 class="n3v4">Categoria 2 (opcional)</h3> <select name="categoria2"> <option value="">Nenhuma</option> <option value="Autos/Pistas">Autos/Pistas</option> <option value="Autos/Ralis-TT">Autos/Ralis-TT</option> <option value="Motos/Pistas">Motos/Pistas</option> <option value="Motos/Ralis-TT">Motos/Ralis-TT</option> <option value="Outros">Outros</option> <option value="Entrevistas">Entrevistas</option> </select> </div> <br/> <h3 class="n3v4">Destaque?</h3> <label class="cbox"> <input type="radio" name="destaque" value="sim" checked>Sim</input> <input type="radio" name="destaque" value="não">Não</input> </label> <br/> <h3 class="n3v4">Publicar já?</h3> <label class="cbox"> <input type="radio" name="publicado" value="sim" checked>Sim</input> <input type="radio" name="publicado" value="não">Não</input> </label> <br/> <input name="news_title" type="text" class="title" placeholder="(título)" data-validation="required" title="required"/> <input name="news_subtitle" type="text" class="title" placeholder="(subtítulo)" data-validation="required" /> <input name="news_desc" type="text" class="description" placeholder="(descrição)" data-validation="required" title="required" maxlength="165"/> <textarea name="news_post" type="text" class="post" placeholder="(notícia)" data-validation="required" title="required" ></textarea> <input name="news_date" type="text" class="date" placeholder="(data)" data-validation="required" title="required" id="datepicker" /> <input name="hour" type="text" class="description" placeholder="(hora HH:MM)" data-validation="required" title="required" maxlength="5" data-format="hh:mm:ss" id="datetimepicker3" /> <input name="news_image" type="text" class="description" placeholder="(imagem homepage)" data-validation="required" title="required"/> <input name="news_image_peq" type="text" class="description" placeholder="(imagem pequena)" data-validation="required" title="required"/></div> <div class="publish-footer"> <input type="submit" name="publish-p" value="Publicar" class="button"> <input type="submit" name="cancel" value="Cancelar" class="secondary button" onclick="window.location='../login/?submit-news'" > </div> </form>
-
Hello. I have a problem with my website. When I introduce the symbols " or ' through text editor (PHP based), the database adds a / to the code. The problem happens in text, but also in pictures or embeded iframes, etc.. Example: Correct snipet of code to go to DB: Felipe Nasr: "seria ótimo chegar à F1 com o António Félix da Costa" How it goes to DB: Felipe Nasr: "/seria ótimo chegar à F1 com o António Félix da Costa/" I have localhost, and two different hosts to my website (.cwahi.net and .atspace.eu). The files are the same in the three cases, but this problem only happens in atspace.eu... Can it be a server problem? Thank you in advance!
-
I need to do, it's a exigence of some media pics databases websites... only for images of course
- 4 replies
-
- disable right click
- right click
-
(and 2 more)
Tagged with: