39,388 Topics
![]() | |
![]() | Hi I don't know how to do this. How can I delete a word from my array. $cheesecake = array("Apple Cheesecake", "Blueberry Cheesecake", "Strawberry Cheesecake", "Mango Cheesecake", "Raspberry Cheesecake"); I want to take out the `Blueberry Cheesecake` from the array. How do I do that? This is what I got … |
Im stuck now it is day four, I have a bunch of clients that upload documents to the web server, the code works if I maually type the names of the documents into the array, but that is not what I want, Mysql has table called "transact" with a field … | |
I would like to create a loop where it will count down and shift every thing to the right by one postion in the array. for example: array('1a','1b','1c','','','1f') should look like this array('1a','','','1b','1c','1f') Starting from position 5 and counting down.$i-- ![]() | |
Hello Everyone. Can you please advise how can I replace a string from this "[" to "]" this character and replace it with blank string? I believe I will use str_replace but I am having a hard time doing this. The quick brown fox jumped over [caption id="attachment_223" align="alignleft" width="900"] … | |
Hello guys For my project i am tring to compare elements of an array with string.This could help at a certain extent to prevent pornographics uploads based on the filenames Here is my snippet $banned_file_names = array('bestiality','lolita','porn','xxx','incest','cock','teenporn'); $filen = preg_replace("/\\.[^.\\s]{3,4}$/", "", $file_name); if (in_array($filen,$banned_file_names) === true) { echo 'Adult image … | |
This is the drop down list of security questions: [CODE] <form action="ddlprocess.php" method="post"> <select name="security1"> <option value="placeOfBirth">What city were you born in?</option> <option value="childhoodFriend">Who was your childhood best friend?</option> <option value="mothersMaiden">What is your mother's maiden name?</option> <option value="mothersMiddle">What is your mother's middle name?</option> <option value="fathersMiddle">What is your father's middle name?</option> … | |
hey guys... just wanna ask, is setting timezone on php automatically computes for daylight saving times? i mean does it autmatically detect DST and automaticaly add +1 hour on specific month? thanks in advance ![]() | |
![]() | Hi, I'm having issue with understanding how this array works in `OOP`. I want to sort this from `ABC` or by `123`. I'm reading about it but I don't know how to run this code. I created the array but making it work is something new to me. //This is … ![]() |
I'm trying to use a drop down form box & select statements to gather certain pieces of information from my database however i'm recieving the error **Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /study/comp/c3329871/webpages/mysql/queryContinent.php on line 26** This is the code from my php file … ![]() | |
I'm quite new to PHP and I'm looking to have a ID pulled from my Database to show a Image in a table and have it alternate in each column. Right now I have the following. <table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="white"> <tr bgcolor="#CCCCCC" align="center"> <td width="36%"><h4>Image</h4></td> </tr> <?php … ![]() | |
Hello, I am getting the following error message: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/mochas/domains/zoink.sx33.net/public_html/includes/blogpost.php on line 54 My code (Line 54): while($row = mysql_fetch_assoc($query)) | |
Hello, I am using php to check if a URL is available using th if file exists function. [code] if(file_exists("http://www.domain.jsp")) { $lines = file('http://www.domain.jsp'); }else{ $lines= echo $variable } [/code] But it keeps giving me errors...is there an alternative to if file exists? Thanks | |
<form action="index.php" method="post" enctype="multipart/form-data"> File: <input type="file" name="image"><input type="submit" value="Upload"> </form> <?php //connect to db mysql_connect("localhost","root","")or die(mysql_error()); mysql_select_db ("databaseimage")or die (mysql_error()); @$file =$_FILES['image']['tmp_name'];//kjo eshte e lidhur me <input type="file" name="image"> if (!isset($file)) echo ("Please select an image"); else { $image= addslashes(file_get_contents ($_FILES['image'] ['tmp_name'])); $image_name = addslashes($_FILES['image']['name']); $image_size = getimagesize ($_FILES['image'] … | |
Hi , I try form many days , but unable to do anything on this niche , Finally I come here to resolve my problem , please help me on that, Problem : I try to add a serach box which search from database and show top 5 result below … | |
Hi I am having some issues with getting data to update for a logged in users account, I have got it to display the data in the database which i want to edit but for some reason it just wont go through it says it has updated but when I … | |
I Need Help With My **.htaccess** file .. Now i have link like that http://www.afrogfx.com/20121028050853/Test.html problem located with **Slash /** !! if you click on my link you will found link without style if remove slash you will get 404 Not Found Like That http://www.afrogfx.com/20121028050853Test.html Try it !! **Here Is … | |
I'm trying to cleanse a db field which stores UK postcodes. Postcodes can be 7 or 8 characters long but they will always have a space character in the 4th position from the end. The last 3 will be 1 digit plus 2 letters. Customers on entering their address will … ![]() | |
I'd like to search this before asking a question but I'm not sure exactly what to search for. Posting for help is always a last resort for me. What I'd like to find is I think it's called a loop? or foreach? I think.. What I want to do is … ![]() | |
I wrote a php email that sends me an email whenever a web form has been submitted. Good thing is that I recieve the email, but bad thing is that I get multiple emails (3x)... one is a duplicate of the table I receieve and another just shows the HTML … | |
Here's my index.php page: <?php require 'connect.php'; ?> <html> <body> <form action="action.php" method="post"> Username: <input type="text" name="uname"> Password: <input type="password" name="pword"> <input type="submit" name="submit1" /> </form> </body> </html> Here's my connect.php page: <?php $connect = mysql_connect("localhost", "root", ""); if (!$connect) { die ('Could not connect: ' . mysql_error ()); } … | |
I get an error when i try to execute this PS: $ADJUST = "UPDATE modul_galleri SET pos = pos - 1 WHERE pos = ?"; $ADJUST_PREP = mysqli_stmt_prepare($connection, $ADJUST); $ADJUST_PREP = mysqli_stmt_bind_param($ADJUST_PREP, "i", $pos_op); $pos_op = $_GET['pos']; $pos_op = $pos_op + 1; mysqli_stmt_execute($ADJUST_PREP) or die(mysqli_stmt_error($ADJUST_PREP)); mysqli_stmt_free_result($ADJUST_PREP); mysqli_stmt_close($ADJUST_PREP); The error: Warning: … | |
This is my index.php page: <html> <body> <form action="action.php" method="post"> Username: <input type="text" name"username"><br /> Password: <input type="password" name="password"> <input type="submit" name="submit" /> </form> </body> </html> This is my action.php page: <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("users", $con); mysql_query("INSERT INTO userlogin … | |
Here's the main index page: <html> <body> <form action="action.php" method="post"> Name: <input type="text" name="fname"> Age: <input type="text" name="age"> <input type="submit" name="mybutton" /> </form> </body> </html> Here's the action page: <?php $mycar=''; echo "$mycar"; ?> I left the variable $mycar empty because i'm trying to assign it's value as my forms … | |
HI, how do i change tis code so when the php is done it gos to page running.php insted of the " echo "1 record added"; " line ? <?php $con = mysql_connect("localhost","peter","abc123"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("my_db", $con); $sql="INSERT INTO Persons (FirstName, LastName, … | |
hello following is my code to add data to database from selecting checkbox bt its not working can u plz help me???? suggest ny changes asap thnks in advance <?php mysql_connect("localhost","root","")or die(mysql_error()); //echo"connection with mysql"; mysql_select_db("cater") or die(mysql_error()); //echo"database cater connected"; foreach ($_POST['check'] as $k=>$c) $query="select * from wed_sweets"; $result=mysql_query($query) … | |
Does anyone know a better way of getting this code to execute the mysql queries. I am trying to Insert table records to a new table then update it. so I need to call the table cms_homecontent first then insert those values to the new table cms_homecontent_versions and also ignore … | |
Hi guys, Im going to properly learn PHP by doing a little project that ive made up. I know the basics of PHP but i havent really done much of it. I need to know how to go about doing what im going to outline below. Please note, i dont … | |
I am baffled, I have the following query which should return 4 records but for some reason it is counting 8 records and returning each row twice. I know I could use distinct, but as I also know that there are no duplicate records in this table I don't want … | |
I would to add row values in an array each column will be an array value. echo '<table>' . "\n"; for ($row = 1; $row <= $highestRow; ++$row) { echo '<tr>' . "\n"; for ($col = 0; $col <= $highestColumnIndex; ++$col) { $values = '<td>' . $objWorksheet->getCellByColumnAndRow($col, $row)->getValue() . '</td>' … ![]() | |
hello how are you today i have a problem with cache when i visit my site i saw the old topic of my site until i hit ctl+f5 to update the page so how ca i solve this problem is there any way to prevent browser store cache i have … ![]() |
The End.